Part Number Hot Search : 
ICS8402 PF0310 CXA1165P SB1188 B5950 UCC5620 TIP30 SB1188
Product Description
Full Text Search
 

To Download W79E2051 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  preliminary w79e4051/w 79e2051 data sheet 8-bit microcontroller publication release date: april 16, 2009 - 1 - revision a06 table of contents- 1 general des cription ......................................................................................................... 4 2 features ....................................................................................................................... .......... 5 3 parts informat ion list ..................................................................................................... 7 3.1 lead free (rohs) parts informati on list ......................................................................... 7 4 pin config uration .............................................................................................................. .8 5 pin descri ption..................................................................................................................... 9 6 functional d escription.................................................................................................. 10 6.1 on-chip flas h eprom ................................................................................................ 10 6.2 i/o ports...................................................................................................................... .. 10 6.3 serial i/o ..................................................................................................................... .. 10 6.4 timers ......................................................................................................................... .. 10 6.5 interrupts..................................................................................................................... .. 10 6.6 data poin ters ................................................................................................................ 10 6.7 architecture................................................................................................................... 11 6.7.1 alu ............................................................................................................................ ....11 6.7.2 accumula tor ...................................................................................................................1 1 6.7.3 b regi ster..................................................................................................................... ..11 6.7.4 program status word: ....................................................................................................11 6.7.5 scratch-pa d ram ...........................................................................................................11 6.7.6 stack po inter .................................................................................................................. 11 7 memory orga nizati on...................................................................................................... 12 7.1 program memory (o n-chip flash) ................................................................................. 12 7.2 data flash memory ...................................................................................................... 12 7.3 scratch-pad ram and re gister map ............................................................................ 12 7.4 working regi sters......................................................................................................... 14 7.5 bit addressable locations............................................................................................. 14 7.6 stack .......................................................................................................................... ... 15 8 special function registers ......................................................................................... 16 9 instruction.................................................................................................................... ...... 37 9.1 instruction timing.......................................................................................................... 45 10 power mana gement.......................................................................................................... 46 10.1 idle mode ...................................................................................................................... 46 10.2 power down mode ....................................................................................................... 46 11 reset cond itions............................................................................................................... 48 11.1 sources of reset............................................................................................................ 48 11.1.1 external reset ..............................................................................................................48 11.1.2 power-on rese t (por)................................................................................................48 11.1.3 brown-out rese t (bor)...............................................................................................48 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 2 - 11.1.4 watchdog timer reset .................................................................................................48 11.2 reset state ................................................................................................................... 4 8 12 interrupts ..................................................................................................................... ...... 51 12.1 interrupt s ources .......................................................................................................... 51 12.2 priority level structure ................................................................................................. 52 12.3 response time............................................................................................................. 54 13 programmable time rs/count ers ............................................................................... 55 13.1 timer/counter s 0 & 1.................................................................................................... 55 13.2 time-base se lection..................................................................................................... 55 13.2.1 mode 0 ......................................................................................................................... 55 13.2.2 mode 1 ......................................................................................................................... 56 13.2.3 mode 2 ......................................................................................................................... 56 13.2.4 mode 3 ......................................................................................................................... 57 14 nvm memory ..................................................................................................................... .... 58 15 watchdog timer................................................................................................................. 59 15.1 watchdog control.............................................................................................. 60 15.2 clock control of watchdog.................................................................................. 60 16 serial port (uart) ............................................................................................................. 62 16.1 mode 0 ........................................................................................................................ 6 2 16.2 mode 1 ........................................................................................................................ 6 3 16.3 mode 2 ........................................................................................................................ 6 5 16.4 mode 3 ........................................................................................................................ 6 6 16.5 framing error detection ............................................................................................... 67 16.6 multiprocessor co mmunicati ons................................................................................... 67 17 pulse width modulated outputs (pwm) ................................................................... 69 18 analog compar ators ...................................................................................................... 71 18.1 comparator interrupt with deb ouncing......................................................................... 72 18.2 application circui t .......................................................................................................... 73 19 time access pr octection .............................................................................................. 74 20 i/o port mode setting ...................................................................................................... 76 20.1 quasi-bidirectional out put configur ation ..................................................................... 76 20.2 open drain output configurat ion ................................................................................. 77 21 oscillator ..................................................................................................................... ...... 78 21.1 on-chip rc oscilla tor opti on....................................................................................... 78 21.2 external clock input option .......................................................................................... 78 22 power monitoring function ........................................................................................ 79 22.1 brownout detect and reset.......................................................................................... 79 23 icp (in-circuit prog ram) flash mode ......................................................................... 81 24 config bits .................................................................................................................... ....... 82 24.1 config0 ...................................................................................................................... 82 24.2 config1 ...................................................................................................................... 83 25 electrical chara cteristics......................................................................................... 84 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 3 - revision a06 25.1 absolute maximu m ratings .......................................................................................... 84 25.2 dc electrical char acterist ics ...................................................................... 85 25.3 the comparator electric al character istics .......................................... 87 25.4 ac electrical ch aracterist ics ...................................................................... 88 25.5 external clock char acterist ics .................................................................. 88 25.6 rc osc and ac char acteristics ...................................................................... 89 26 typical applicatio n circui ts ........................................................................................ 90 27 package dime nsions ......................................................................................................... 91 27.1 20-pin so p ................................................................................................................... 91 27.2 20-pin dip ..................................................................................................................... 92 27.3 20-pin sso p ................................................................................................................. 93 28 revision histor y ............................................................................................................... .94 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 4 - 1 general description the w79e4051/2051 series are an 8-bit turbo 51 microcontroller which has an in-system programmable flash eprom which flash eprom can program by icp (in circuit program) writer . the instruction set of the w79e4051/2051 series ar e fully compatible with the standard 8052. the w79e4051/2051 series contain a 4k/2k bytes of program flash eprom; a 256 bytes of ram; 128 bytes data flash eprom for customer data storage; two 8-bit bi-directional and bit-addressable i/o ports; two 16-bit timer/counters; an enhanced full duplex serial port; 1 channel pwm by 10-bit counter, brownout voltage detection/reset, power on reset detection and one analog comparator. these peripherals are supported by 9 sources of four-level interrupt capability. to facilitate programming and verification, the flash eprom inside the w79e4 051/2051 series allow the program memory to be programmed and read electronically. once the code is confirmed, the user can protect the code for security. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 5 - revision a06 2 features ? fully static design 8-bit turbo 51 cmos microcontroller up to 24mhz ? single power: 2.4~5.5v up to 12mhz, 4.5~5.5v up to 24mhz ? flexible cpu clock source configurable by config bit and software: - high speed external oscillator: upto 24mhz cr ystal and resonator (enabled by config bit). - internal rc oscillator: 22.1184/11.0592mhz with 2% accuracy (selectable by config bit), at 5.0 voltage and 25 condition, for W79E2051r and w79e4051r ? instruction-set compatible with mcs-51 ? 4k/2k bytes of program flash eprom, with ic p and external writer programmable mode. ? 256 bytes of on-chip ram ? w79e4051/2051 supports 128 bytes data flash eprom for cu stomer data storage used and 10k writer cycles. - 8 pages. page size is 16 bytes. - data flash program/erase v dd =3.0v to 5.5v ? one 8-bit bi-directional port(port1), one 7-bit bi-directional port(port3) and one 2-bit bi- directional port(p2.0 and p2.1 shared with xt1 and xt2 pins) ? i/o capable of driving led max. 20ma per pin, max to 80ma for total pins. ? two 16-bit timer/counters ? 9 interrupt source with four levels of priority ? one enhanced full duplex serial port with framing error detection and automatic address recognition ? one channel 10-bit pwm output ? one analog comparator ? built-in power management - power on reset flag - brownout voltage detect/reset ? operating temperature: -40~85 ? packages: - lead free (rohs) pdip 20: w79e4051akg - lead free (rohs) sop 20: w79e4051asg - lead free (rohs) ssop 20: w79e4051arg - lead free (rohs) pdip 20: W79E2051akg - lead free (rohs) sop 20: W79E2051asg - lead free (rohs) ssop 20: W79E2051arg - lead free (rohs) pdip 20: w79e4051rakg - lead free (rohs) sop 20: w79e4051rasg - lead free (rohs) ssop 20: w79e4051rarg www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 6 - - lead free (rohs) pdip 20: W79E2051rakg - lead free (rohs) sop 20: W79E2051rasg - lead free (rohs) ssop 20: W79E2051rarg www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 7 - revision a06 3 parts information list 3.1 lead free (rohs) parts information list table 3-1: lead free (rohs) parts information list part no. program flash eprom ram data flash eprom internal rc oscillator accuracy 1 package w79e4051akg 4kb 256b 128b 22mhz 25% pdip-20 pin w79e4051asg 4kb 256b 128b 22mhz 25% sop-20 pin w79e4051arg 4kb 256b 128b 22mhz 25% ssop-20 pin W79E2051akg 2kb 256b 128b 22mhz 25% pdip-20 pin W79E2051asg 2kb 256b 128b 22mhz 25% sop-20 pin W79E2051arg 2kb 256b 128b 22mhz 25% ssop-20 pin w79e4051rakg 4kb 256b 128b 22.1184mhz 2% pdip-20 pin w79e4051rasg 4kb 256b 128b 22.1184mhz 2% sop-20 pin w79e4051rarg 4kb 256b 128b 22.1184mhz 2% ssop-20 pin W79E2051rakg 2kb 256b 128b 22.1184mhz 2% pdip-20 pin W79E2051rasg 2kb 256b 128b 22.1184mhz 2% sop-20 pin W79E2051rarg 2kb 256b 128b 22.1184mhz 2% ssop-20 pin note: 1. factory calibration condition: v dd =5.0v, ta = 25 c www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 4 pin configuration vcc p1.7 p1.6 p1.5 p1.4 p1.3 p1.2 p1.1/an1- p1.0/an0+ p3.7 1 2 3 4 5 6 7 8 9 10 mode/rst rxd/p3.0 txd/p3.1 xtal2/p2.0 xtal1/p2.1 int0/p3.2 int1/p3.3 t0/p3.4 pwm0/t1/p3.5 gnd 20 19 18 17 16 15 14 13 10 11 20 pin dip/sop table 4-1: pin configuration - 8 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 9 - revision a06 5 pin description symbol alternate function 1 alternate function 2 alternate function 3 (icp mode) type descriptions p2.1 x1 i/o i crystal1 : this is the crystal oscillator input. this pin may be driven by an external clock or configurable i/o pin. p2.0 x2/clkout i/o o crystal2 : this is the crystal oscillator output. it is the inversion of xtal1. also a configurable i/o pin. vdd - p power supply : supply voltage for operation. vss - p ground : ground potential. rst mode i reset : a high on this pin for two machine cycles while the oscillator is running resets the device. mode: used in icp mode. p1.0 an0+ i/o, d p1.1 an1- i/o, d p1.2 i/o p1.3 i/o p1.4 i/o p1.5 i/o p1.6 data i/o p1.7 sck i/o port1 : 8-bit bi-directional i/o port with internal weakly pull-ups. p1.0~p1.1 are open-drain mode after reset. multifunction pins: an0+ and an1- are analog comparator inputs. data and sck are used in icp mode. p3.0 rxd i/o p3.1 txd i/o p3.2 /int0 i/o p3.3 /int1 i/o p3.4 t0 i/o p3.5 t1 pwm0 i/o p3.6 s p3.7 i/o port3 : 7-bit bi-directional i/o port, p3.0~p3.7 except p3.6, with internal weakly pull- ups. p3.6 is internal wired to analog comparator output . multifunction pins for txd & rxd (uart),/int0-1, t0, t1/pwm0. * note : type p : power, i: input, o : output, i/o : bi-directional, s : internal signal. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 6 functional description the w79e4051/2051 architecture consist of a 4t 8051 core controller surrounded by various registers, 4k/2k bytes ap flash eprom, 256 bytes of ram, 128 bytes data flash eprom, three general purpose i/o ports, two timer/counters, one serial port, flash eprom program by writer and icp. 6.1 on-chip flash eprom the w79e4051/2051 includes one 4k/2k bytes of main flash eprom for application program. a writer or icp programming board is required to program the ap flash eprom and data flash eprom. this icp (in-circuit programming) feature makes t he job easy and efficient when the application?s firmware needs to be updated frequently . in some applications, the in-circuit programming feature makes it possible for the end-user to easily update the system firmware without opening the chassis. 6.2 i/o ports w79e4051/2051 has one 8-bit, one 7-bit and one 2-bit por ts using on-chip oscillator by reset options. except p1.0 and p1.1, all ports are in quasi-bidrectio nal structure that the internal weakly pull-ups are present as the port registers are set to logic one. p1.0~p1.1, the alternate function are analog comparator inputs, stays in pmos-o ff open-drain mode after cpu reset. 6.3 serial i/o the w79e4051/2051 has one serial port that is functi onally similar to the serial port of the original 8051 family. however the serial port on the w79e4051/ 2051 can operate in different modes in order to obtain timing similarity as well. the serial por t has the enhanced features of automatic address recognition and frame error detection. 6.4 timers the w79e4051/2051 has two 16-bit timers that are f unctionally and similar to the timers of the 8051 family. when used as timers, user has a choice to set 12 or 6 clocks per count that emulates the timing of the original 8051. each timer?s count value is stored in two sfr locations that can be written or read by software. there are also some other sf rs associated with the timers that control their mode and operation. 6.5 interrupts the interrupt structure in the w79e 4051/2051 is slightly different from that of the standard 8051. due to the presence of additional features and periphe rals, the number of interrupt sources and vectors has been increased. 6.6 data pointers the data pointer of w79e4051/2051 is similar to standard 8051 but has dual 16-bit data pointers (dptr) by setting dps of auxr2.0. in addition th ere is an added instruction, dec dptr (op-code a5h), which helps in improving programming flexibility for the user. - 10 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 11 - revision a06 table 6-1: data pointer 6.7 architecture the w79e4051/2051 is based on the standard mcs- 51 device. it is built around an 8-bit alu that uses internal registers for temporary storage and control of the peripheral devices. it can execute the standard mcs-51 instruction set. 6.7.1 alu the alu is the heart of the w79e4051/2051. it is responsible for the arithmetic and logical functions. it is also used in decision making, in case of jump instructions, and is also used in calculating jump address. the user cannot direct ly use the alu, but the instru ction decoder reads the op-code, decodes it, and sequences the data through the al u and its associated registers to generate the required result. the alu mainly uses the acc which is a special function register (sfr) on the chip. another sfr, namely b register is also used in multiply and divide instructions. the alu generates several status signals which are stored in the program status word register (psw). 6.7.2 accumulator the accumulator (acc) is the primary register used in arithmetic, logical and data transfer operations in the w79e4051/2051. since the accumulator is dire ctly accessible by the cpu, most of the high speed instructions make use of the acc as one argument. 6.7.3 b register this is an 8-bit register that is used as the se cond argument in the mul and div instructions. for all other instructions it can be used simply as a general purpose register. 6.7.4 program status word: this is an 8-bit sfr that is used to store the status bits of the alu. it holds the carry flag, the auxiliary carry flag, general purpose flags, the register bank select, the overflow flag, and the parity flag. 6.7.5 scratch-pad ram the w79e4051/2051 has a 256 byte on-chip scratch- pad ram. this can be used by the user for temporary storage during program execution. a certai n section of this ram is bit addressable, and can be directly addressed for this purpose. 6.7.6 stack pointer the w79e4051/2051 has an 8-bit stack pointer which points to the top of the stack. this stack resides in the scratch pad ram in the w79e4051/2051. hence the size of the stack is limited by the size of this ram. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 7 memory organization the w79e4051/2051 series separate the memory in to two separate sections, the program memory and the data memory. the program memory is used to store the instruction op-codes, while the data memory is used to store data or for memory mapped devices. 7.1 program memory (on-chip flash) the program memory on the w79e4051/2051 series can be up to 4k/2k bytes long. all instructions are fetched for execution from this memory area. th e movc instruction can also access this memory region. 7.2 data flash memory the data flash eprom on the w79e4051/2051 series is 128 bytes long with page size of 16 bytes. the w79e4051/2051 series read the content of data memory by using ?movc a, @a+dptr?. to write data is by nvmaddrl, nvmdata and nvmcon sfr?s registers. w79e4051/2051 on-chip flash memory space 0000h 4k/2k bytes on-chip code memory unused code memory unused code memory 0fffh/07ffh ffffh fc00h fc7fh 128 bytes nvm data memory nvm data memory area fc1fh fc10h fc0fh fc00h page 0 page 1 page 7 page 2 page 3 page 4 page 5 page 6 128 bytes nvm 16 bytes/page fc3fh fc30h fc2fh fc20h fc5fh fc50h fc4fh fc40h fc7fh fc70h fc6fh fc60h config1 config0 table 7-1 w79e4051/2051 on-chip flash memory map 7.3 scratch-pad ram and register map - 12 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet as mentioned before the w79e4051/2051 series hav e separate program and data memory areas. the on-chip 256 bytes scratch pad ram is built in w79e4051/2051. there are also several special function registers (sfrs) which can be accessed by software. t he sfrs can be accessed only by direct addressing, while the on-chip ram can be acce ssed by either direct or indirect addressing. table 7-2 w79e4051/2051 256 bytes ram and sfr memory map since the scratch-pad ram is 256 bytes it can be used only when data contents are small. there are several other special purpose areas within the sc ratch-pad ram. these are illustrated in next figure. publication release date: april 16, 2009 - 13 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet bank 0 bank 1 bank 2 bank 3 03 02 01 00 04 05 06 07 0b 0a 09 08 0c 0d 0e 0f 13 12 11 10 14 15 16 17 1b 1a 19 18 1c 1d 1e 1f 23 22 21 20 24 25 26 27 2b 2a 29 28 2c 2d 2e 2f 33 32 31 30 34 35 36 37 3b 3a 39 38 3c 3d 3e 3f 43 42 41 40 44 45 46 47 4b 4a 49 48 4c 4d 4e 4f 53 52 51 50 54 55 56 57 5b 5a 59 58 5c 5d 5e 5f 63 62 61 60 64 65 66 67 6b 6a 69 68 6c 6d 6e 6f 73 72 71 70 74 75 76 77 7b 7a 79 78 7c 7d 7e 7f direct ram indirect ram 00h 07h 28h 08h 0fh 10h 17h 18h 1fh 20h 21h 22h 23h 24h 25h 26h 27h 29h 2ah 2bh 2ch 2dh 2eh 2fh 30h 7fh 80h ffh table 7-3 scratch-pad ram 7.4 working registers there are four sets of working r egisters, each consisting of eight 8-bit registers. these are termed as banks 0, 1, 2, and 3. individual registers within these banks can be directly accessed by separate instructions. these individual registers are named as r0, r1, r2, r3, r4, r5, r6 and r7. however, at one time the w79e4051/2051 series can work with only one particular bank. the bank selection is done by setting rs1-rs0 bits in the psw. the r0 and r1 registers are used to store the address for indirect accessing. 7.5 bit addressable locations - 14 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 15 - revision a06 the scratch-pad ram area from location 20h to 2fh is byte as well as bit addressable. this means that a bit in this area can be individually addresse d. in addition some of the sfrs are also bit addressable. the instruction decoder is able to distinguish a bit access from a byte access by the type of the instruction itself. in the sfr area, any ex isting sfr whose address ends in a 0 or 8 is bit addressable. 7.6 stack the scratch-pad ram can be used for the stack. this area is selected by the stack pointer (sp), which stores the address of the t op of the stack. whenever a jump, call or interrupt is invoked the return address is placed on the sta ck. there is no restriction as to where the stack can begin in the ram. by default however, the stack pointer contains 07h at reset. the user can then change this to any value desired. the sp will point to the last us ed value. therefore, the sp will be incremented and then address saved onto the stack. conversely, while popping from the stack the contents will be read first, and then the sp is decreased. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 16 - 8 special function registers the w79e4051/2051 series uses special functi on registers (sfrs) to control and monitor peripherals and their modes. the sfrs reside in th e register locations 80-ffh and are accessed by direct addressing only. some of the sfrs are bit addressable. this is very useful in cases where users wish to modify a particular bit without changi ng the others. the sfrs that are bit addressable are those whose addresses end in 0 or 8. the w79e 4051/2051 series contain all the sfrs present in the standard 8052. however some additional sfrs are added. in some cases the unused bits in the original 8052, have been given new functions . the list of the sfrs is as follows. f8 ip1 f0 b pcmpids ip1h e8 eie e0 acc d8 wdcon pwmpl pwm0l pwmcon1 d0 psw pwmph pwm0h pwmcon3 c8 nvmcon nvmdata c0 nvmaddrl ta b8 ip0 saden b0 p3 p1m1 ip0h a8 ie saddr a0 p2 auxr1 auxr2 98 scon sbuf 90 p1 acck acsr 88 tcon tmod tl0 tl1 th0 th1 ckcon clkreg 80 sp dpl dph pcon table 8-1: special function register location table note: 1. the sfrs in the column with dark borders are bit-addressable 2. the table is condensed with eight locations per row. empty locations indicate that these are no registers at t hese addresses. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 17 - revision a06 special function registers: symbol definition address msb bit address, symbol lsb reset ip1 interrupt priority 1 f8h (ff) - (fe) pbov (fd) ppwm (fc) pwdi (fb) - (fa) - (f9) - (f8) - x000 xxxxb ip1h interrupt high priority 1 f7h - pbovh ppwmh pwdih - - - - x000 xxxxb pcmpids port comparator input disable f6h - - - - - - b1 b0 xxxx 0000b b b register f0h (f7) (f6) (f5) (f4) (f3) (f2) (f1) (f0) 00000000b eie interrupt enable 1 e8h (ef) - (ee) ebov (ed) epwm (ec) ewdi (eb) - (ea) - (e9) - (e8) - xx000 xxxxb acc accumulator e0h (e7) (e6) (e5) (e4) (e3) (e2) (e1) (e0) 00000000b pwmcon1 pwm control register 1 dch pwmrun load pwmf clrpwm - - - pwm0i 0000 0000b pwm0l pwm 0 low bits register dah pwm0.7 pwm0.6 pwm0.5 pwm0.4 pwm0.3 pwm0.2 pwm0.1 pwm0.0 0000 0000b pwmpl pwm counter low register d9h pwmp0.7 pwmp0.6 pwmp0.5 pwmp0.4 pwmp0.3 pwmp0.2 pwmp0.1 pwmp0.0 0000 0000b wdcon watch-dog control d8h (df) wdrun (de) - (dd) wd1 (dc) wd0 (db) wdif (da) wtrf (d9) ewrst (d8) wdclr 0x00 0000b pwmcon3 pwm control register 3 d7h - - - pwm0oe - - fp1 fp0 0000 xx00b pwm0h pwm 0 high bits register d2h - - - - - - pwm0.9 pwm0.8 xxxx xx00b pwmph pwm counter high register d1h - - - - - - pwmp0.9 pwmp0.8 xxxx xx00b psw program st atus word d0h (d7) cy (d6) ac (d5) f0 (d4) rs1 (d3) rs0 (d2) ov (d1) f1 (d0) p 00000000b nvmdata nvm data cfh 00000000b nvmcon nvm control ceh eer ewr - - - - - 00xxxxxxb ta timed access protection c7h ta.7 ta.6 ta.5 ta.4 ta.3 ta.2 ta.1 ta.0 11111111b nvmaddrl nvm byte address c6h nvmaddr .7 nvmaddr. 6 nvmaddr .5 nvmaddr .4 nvmadd r.3 nvmadd r.2 nvmadd r.1 nvmaddr .0 00000000b saden slave address mask b9h 00000000b ip0 interrupt priority 0 b8h (bf) - (be) pc (bd) - (bc) ps (bb) pt1 (ba) px1 (b9) pt0 (b8) px0 x0x00000b ip0h interrupt high priority 0 b7h - p ch - psh pt1h px1h pt0h px0h x0x00000b p1m1 port1 mode 1 b3h - - - - - - p1m1.1 p1m1.0 xxxx xx00b p3 port 3 b0h (b7) (b6) (b5) t1 (b4) t0 (b3) int1 (b2) int0 (b1) txd (b0) rxd 11111111b saddr slave address a9h 00000000b ie interrupt enable a8h (af) ea (ae) ec (ad) - (ac) es (ab) et1 (aa) ex1 (a9) et0 (a8) ex0 00x00000b auxr2 aux function register 2 a3h dps xxxx xxx0b auxr1 aux function register 1 a2h bof bod 2 boi lpbov srst bov1 3 bov0 3 bos 0x00 0xx0b p2 port 2 a0h (a7) - (a6) - (a5) - (a4) - (a3) - (a2) - (a1) p2.1 xtal1 (a0) p2.0 xtal2 clkout xxxx xxxxb sbuf serial buffer 99h xxxxxxxxb scon serial control 98h (9f) sm0/fe (9e) sm1 (9d) sm2 (9c) ren (9b) tb8 (9a) rb8 (99) ti (98) ri 00000000b acsr analog comparator control & status register 97h - - cipe cf cen cm2 cm1 cm0 xx000000b acck analog comparator debounce clock control 96h enclk - - - - cpck2 cpck1 cpck0 0000 0000b p1 port 1 90h (97) (96) (95) (94) (93) (92) (91) (90) 11111111b clkreg 8fh pwdex1 pwdex0 xxxx x00xb ckcon clock control 8eh - - - t1m t0m - - - xxx00xxxb th1 timer high 1 8dh 00000000b th0 timer high 0 8ch 00000000b tl1 timer low 1 8bh 00000000b tl0 timer low 0 8ah 00000000b tmod timer mode 89h gate c/t1# m1 m0 gate c/t0# m1 m0 00000000b tcon timer control 88h (8f) tf1 (8e) tr1 (8d) tf0 (8c) tr0 (8b) ie1 (8a) it1 (89) ie0 (88) it0 00000000b pcon power control 87h smod smod0 por gf 1 gf0 pd idl 00xx0000b dph data pointer high 83h 00000000b dpl data pointer low 82h 00000000b sp stack pointer 81h 00000111b table 8-2: special function registers www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 18 - note : 1. in column bit_address, symbol , containing ( ) item means the bit address. 2. bod is initialized at reset with the in versed value of bit cbod in config0-bits. 3. (bov1,bov0) are initialized at reset with the reversed value of config0-bits (cbov1,cbov0) www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 19 - revision a06 stack pointer bit: 7 6 5 4 3 2 1 0 sp.7 sp.6 sp.5 sp.4 sp.3 sp.2 sp.1 sp.0 mnemonic: sp address: 81h bit name function 7-0 sp.[7:0] the stack pointer stores the scra tch-pad ram address where the stack begins. in other words it always points to the top of the stack. data pointer low bit: 7 6 5 4 3 2 1 0 dpl.7 dpl.6 dpl.5 dpl.4 dpl.3 dpl.2 dpl.1 dpl.0 mnemonic: dpl address: 82h bit name function 7-0 dpl.[7:0] this is the low byte of the standard 8052 16-bit data pointer. data pointer high bit: 7 6 5 4 3 2 1 0 dph.7 dph.6 dph.5 dph.4 dph.3 dph.2 dph.1 dph.0 mnemonic: dph address: 83h bit name function 7-0 dph.[7:0] this is the high byte of the standard 8052 16-bit data pointer. power control bit: 7 6 5 4 3 2 1 0 smod smod0 - por gf1 gf0 pd idl mnemonic: pcon address: 87h bit name function 7 smod 1: this bit doubles the serial port baud rate in mode 1, 2, and 3. 6 smod 0 0: framing error detection disable. scon.7 (sm0/fe) bit is used as sm0 (standard 8052 function). 1: framing error detection enable. scon.7 (sm0/fe) bit is used to reflect as frame error (fe) status flag. 5 - reserved 4 por 0: cleared by software. 1: set automatically when a power-on reset has occurred. 3 gf1 general purpose user flags. 2 gf0 general purpose user flags. 1 pd 1: the cpu goes into the power down mode. in this mode, all the clocks are stopped and program execution is frozen. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 0 idl 1: the cpu goes into the idle mode. in this mode, the clocks cpu clock stopped, so program execution is frozen. but the clock to the serial, timer and interrupt blocks is not stopped, and these blocks continue operating. timer control bit: 7 6 5 4 3 2 1 0 tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 mnemonic: tcon address: 88h bit name function 7 tf1 timer 1 overflow flag. this bit is set when timer 1 overflows. it is cleared automatically when the program does a timer 1 interrupt service routine. software can also set or clear this bit. 6 tr1 timer 1 run control. this bit is set or cleared by software to turn timer/counter on or off. 5 tf0 timer 0 overflow flag. this bit is set when timer 0 overflows. it is cleared automatically when the program does a timer 0 interrupt service routine. software can also set or clear this bit. 4 tr0 timer 0 run control. this bit is set or cleared by software to turn timer/counter on or off. 3 ie1 interrupt 1 edge detect flag: set by hardware when an edge/level is detected on 1int . this bit is cleared by hardware when t he service routine is vectored to only if the interrupt was edge triggered. otherwise it follows the inverse of the pin. 2 it1 interrupt 1 type control. set/cleared by software to specify falling edge/ low level triggered external inputs. 1 ie0 interrupt 0 edge detect flag. set by hardware when an edge/level is detected on 0int . this bit is cleared by hardware when the service routine is vectored to only if the interrupt was edge triggered. other wise it follows the inverse of the pin. 0 it0 interrupt 0 type control: set/cleared by software to specify falling edge/ low level triggered external inputs. timer mode control bit: 7 6 5 4 3 2 1 0 gate tc / m1 m0 gate tc / m1 m0 timer1 timer0 mnemonic: tmod address: 89h bit name function 7 gate gating control: when this bit is set, timer/counter 1 is enabled only while the 1int pin is high and the tr1 control bit is set. when cleared, the 1int pin has no effect, and timer 1 is enabled whenever tr1 control bit is set. 6 tc/ timer or counter select: when clear, timer 1 is incremented by the internal clock. when set, the timer counts falling edges on the t1 pin. 5 m1 timer 1 mode select bit 1. see table below. - 20 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 4 m0 timer 1 mode select bit 0. see table below. 3 gate gating control: when this bit is set, timer/counter 0 is enabled only while the 0int pin is high and the tr0 control bit is set. when cleared, the 0int pin has no effect, and timer 0 is enabled whenever tr0 control bit is set. 2 tc/ timer or counter select: when clear, timer 0 is incremented by the internal clock. when set, the timer counts falling edges on the t0 pin. 1 m1 timer 0 mode select bit 1. see table below. 0 m0 timer 0 mode select bit 0. see table below. m1, m0: mode select bits: m1 m0 mode 0 0 mode 0: 8-bit timer/counter tlx serves as 5-bit pre-scale. 0 1 mode 1: 16-bit timer/counter, no pre-scale. 1 0 mode 2: 8-bit timer/counter with auto-reload from thx. 1 1 mode 3: (timer 0) tl0 is an 8-bit timer/ counter controlled by the standard timer0 control bits. th0 is an 8-bit timer only cont rolled by timer1 control bits. (timer 1) timer/counter 1 is stopped. timer 0 lsb bit: 7 6 5 4 3 2 1 0 tl0.7 tl0.6 tl0.5 tl0.4 tl0.3 tl0.2 tl0.1 tl0.0 mnemonic: tl0 address: 8ah bit name function 7-0 tl0.[7:0] timer 0 lsb. timer 1 lsb bit: 7 6 5 4 3 2 1 0 tl1.7 tl1.6 tl1.5 tl1.4 tl1.3 tl1.2 tl1.1 tl1.0 mnemonic: tl1 address: 8bh bit name function 7-0 tl1.[7:0] timer 1 lsb. timer 0 msb bit: 7 6 5 4 3 2 1 0 th0.7 th0.6 th0.5 th0.4 th0.3 th0.2 th0.1 th0.0 mnemonic: th0 address: 8ch bit name function 7-0 th0.[7:0] timer 0 msb. publication release date: april 16, 2009 - 21 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet timer 1 msb bit: 7 6 5 4 3 2 1 0 th1.7 th1.6 th1.5 th1.4 th1.3 th1.2 th1.1 th1.0 mnemonic: th1 address: 8dh bit name function 7-0 th1.[7:0] timer 1 msb. clock control bit: 7 6 5 4 3 2 1 0 - - - t1m t0m - - - mnemonic: ckcon address: 8eh bit name function 7-5 - reserved. 4 t1m timer 1 clock select: 0: timer 1 uses a divide by 12 clocks. 1: timer 1 uses a divide by 6 clocks. 3 t0m timer 0 clock select: 0: timer 0 uses a divide by 12 clocks. 1: timer 0 uses a divide by 6 clocks. 2-0 - reserved. clock register bit: 7 6 5 4 3 2 1 0 - - - - - pwdex1 pwdex0 - mnemonic: cldreg address: 8fh bit name function 7-5 - reserved. 2 pwdex1 power down exit mode. 1 pwdex0 power down exit mode. 0 - reserved. power down exit mode: pwdex1 pwdex0 power down exit mode 0 0 wake up from power down is internally timed. int0 or int1 must be configured for low-level trigger mode. 0 1 wake up from power down is externally controlled. int0 or int1 must be configured for low-level trigger mode. 1 x wake up from power down immediately. int0 or int1 can be configured for low-level or edge trigger mode. - 22 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 23 - revision a06 port 1 bit: 7 6 5 4 3 2 1 0 p1.7 p1.6 p1.5 p1.4 p1.3 p1.2 p1.1 p1.0 mnemonic: p1 address: 90h p1.7-0: general purpose input/output port. most instructions will read the port pins in case of a port read access, however in case of r ead-modify-write instructions, the por t latch is read. these alternate functions are described below: bit name function 1 p1.1 an1+ 0 p1.0 an0- analog comparator debounce clock control bit: 7 6 5 4 3 2 1 0 enclk - - - - cpck2 cpck1 cpck0 mnemonic: acck address: 96h bit name function 7 enclk 1: enable clock output to the xta l2 pin (p2.0) when cpu clock is from the external osc or on-chip rc oscillator. t he frequency of the clock output is 1/4 of the cpu clock rate. 6-3 - reserved. 2 cpck2 see as below table. 1 cpck1 see as below table. 0 cpck0 see as below table. comparator debouncing time setting: cpck2 cpck 1 cpck 0 debouncing time 0 0 0 (3/f db )*2~(4/f db )*2 0 0 1 (3/f db )*4~(4/f db )*4 0 1 0 (3/f db )*8~(4/f db )*8 0 1 1 (3/f db )*16~(4/f db )*16 1 0 0 (3/f db )*32~(4/f db )*32 1 0 1 (3/f db )*64~(4/f db )*64 1 1 0 (3/f db )*128~(4/f db )*128 analog comparator control & status register bit: 7 6 5 4 3 2 1 0 - - cipe cf cen cm2 cm1 cm0 mnemonic: acsr address: 97h www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 24 - bit name function 7-6 - reserved. 5 cipe comparator enabled in idle and power down mode. 0: comparator disabled in idle and power down mode. (default) 1: comparator enabled in idle and power down mode. 4 cf comparator interrupt flag. set by hardware when the compar ator output meet the conditions specified by the cm[2:0] bits and cen is set. the flag must be cleared by software. the interrupt may be enabled/disabled by setting/clearing bit 6 of ie. 3 cen enable comparator. set this bit to enable the comparator. clearing this bit will force the comparator output low and prevent further events from setting cf. 2 cm2 see as below table. 1 cm1 see as below table. 0 cm0 see as below table. comparator interrupt mode setting: cm2 cm1 cm0 interrupt mode 0 0 0 negative (low) level 0 0 1 positive edge 0 1 0 toggle with debounce 0 1 1 positive edge with debounce 1 0 0 negative edge 1 0 1 toggle 1 1 0 negative edge with debounce 1 1 1 positive (high) level serial port control bit: 7 6 5 4 3 2 1 0 sm0/fe sm1 sm2 ren tb8 rb8 ti ri mnemonic: scon address: 98h bit name function 7 sm0/fe serial port mode select bit 0 or framing error flag: the smod0 bit in pcon sfr determines whether this bit acts as sm0 or as fe. the operation of sm0 is described below. when used as fe, this bit will be set to indicate an invalid stop bit. this bit must be manually cleared in software to clear the fe condition. 6 sm1 serial port mode select bit 1. see table below. 5 sm2 multiple processors communication. setting this bit to 1 enables the multiprocessor communication feature in mode 2 and 3. in mode 2 or 3, if sm2 is set to 1, then ri will not be activated if the received 9th data bit (rb8) is 0. in mode 1, if sm2 = 1, then ri will not be activated if a valid stop bit was not received. in mode 0, the sm2 bit controls the serial port clock. if set to 0, then the serial port runs at a divide by 12 clock of the oscillator. this gives compatibility with the standard 8052. when set to 1, the serial clock become www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 25 - revision a06 divide by 4 of the oscillator clock. this results in faster synchronous serial communication. 4 ren receive enable: 0: disable serial reception. 1: enable serial reception. 3 tb8 this is the 9th bit to be transmitted in modes 2 and 3. this bit is set and cleared by software as desired. 2 rb8 in modes 2 and 3 this is the received 9th data bit. in mode 1, if sm2 = 0, rb8 is the stop bit that was received. in mode 0 it has no function. 1 ti transmit interrupt flag: this flag is se t by hardware at the end of the 8th bit time in mode 0, or at the beginning of the stop bit in all other modes during serial transmission. this bit must be cleared by software. sm1, sm0: mode select bits: mode sm0 sm1 description length baud rate 0 0 0 synchronous 8 tclk divided by 4 or 12 1 0 1 asynchronous 10 variable 2 1 0 asynchronous 11 tclk divided by 32 or 64 3 1 1 asynchronous 11 variable serial data buffer bit: 7 6 5 4 3 2 1 0 sbuf.7 sbuf.6 sbuf.5 sbuf.4 sbuf.3 sbuf.2 sbuf.1 sbuf.0 mnemonic: sbuf address: 99h bit name function 7~0 sbuf serial data on the serial port is read fr om or written to this location. it actually consists of two separate internal 8-bit registers. one is the receive resister, and the other is the transmit buffer. any read access gets data from the receive data buffer, while write access is to the transmit data buffer. port 2 bit: 7 6 5 4 3 2 1 0 - - - - - - p2.1 p2.0 mnemonic: p2 address: a0h bit name alternate function 7-2 - reserved 1 p2.1 xtal1 clock input pin. 0 p2.0 xtal2 or clkout pin by alternative. aux function register 1 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 26 - bit: 7 6 5 4 3 2 1 0 bof bod boi lpbov srst bov1 bov0 bos mnemonic: auxr1 address: a2h bit name function 7 bof brown out flag 0: cleared by software. 1: set automatically when a brownout reset or interrupt has occurred. also set at power on. 6 bod brown out disable: bod is initialized at reset with the inve rsed value of bit cbod in config0-bits. 0: enable brownout detect function. 1: disable brownout detect function and save power. 5 boi brown out interrupt: 0: disable brownout detect interrupt function and it will cause chip reset when bof is set. 1: this prevents brownout detection fr om causing a chip reset and allows the brownout detect function to be used as an interrupt. 4 lpbov low power brown out detect control: 0: if bit bod=0, the brown out detection is always active. 1: if bit bod=0, the brown out detection repeats to senses the voltage for 64/f brc then turn off detector for 960/f brc , therefore, it saves 15/16 of the brownout circuit power. 3 srst software reset: this bit has ta(time accessed) protection in write access. 1: reset the chip as if a hardware reset occurred. 2~1 bov1, bov0 brownout voltage selection bits: (bov1,bov0) are initialized at reset with the reversed value of bits (cbov1,cbov0) in config0-bits bov.1 bov.0 brownout voltage 0 0 brownout voltage is 2.4v 0 1 brownout voltage is 2.7v 1 0 brownout voltage is 3.8v 1 1 brownout voltage is 4.5v 0 bos brownout status bit(read only) 0: v dd is above v bor+ 1: v dd is below v bor- brownout voltage selection bov1 bov0 brownout voltage 0 0 brownout voltage is 2.4v 0 1 brownout voltage is 2.7v 1 0 brownout voltage is 3.8v www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 27 - revision a06 1 1 brownout voltage is 4.5v all the bits in this sfr have unrestricted read access. srst require timed access procedure to write. the remaining bits have unrestricted write acce sses. please refer ta register description. aux function register 2 bit: 7 6 5 4 3 2 1 0 - - - - - - - dps mnemonic: auxr2 address: a3h bit name function 7-1 - reserved 0 dps dual data pointer select 0: to select dptr of standard 8051. 1: to select dptr1 interrupt enable bit: 7 6 5 4 3 2 1 0 ea ec - es et1 ex1 et0 ex0 mnemonic: ie address: a8h bit name function 7 ea global enable. enable/disable all interrupts. 6 ec enable analog comparator interrupt. 5 - reserved. 4 es enable serial port 0 interrupt. 3 et1 enable timer 1 interrupt. 2 ex1 enable external interrupt 1. 1 et0 enable timer 0 interrupt. 0 ex0 enable external interrupt 0. slave address bit: 7 6 5 4 3 2 1 0 saddr.7 saddr.6 saddr.5 saddr.4 saddr.3 saddr.2 saddr.1 saddr.0 mnemonic: saddr address: a9h bit name function 7~0 saddr the saddr should be programmed to the given or broadcast address for serial port to which the slave processor is designated. port 3 bit: 7 6 5 4 3 2 1 0 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet p3.7 cmp_o p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 mnemonic: p3 address: b0h p3.7-0: general purpose input/output port. most instructions will read the port pins in case of a port read access, however in case of read-modify-write instructions, the port latch is read. these alternate functions are described below: bit name function 7 p3.7 - 6 cmp_o read only. this bit stores the hardware comparator result. 5 p3.5 t1 or pwm output 4 p3.4 t0 3 p3.3 int1 2 p3.2 int0 1 p3.1 tx 0 p3.0 rx port1 output mode 1 bit: 7 6 5 4 3 2 1 0 - - - - - - p1m1.1 p1m1.0 mnemonic: p1m1 address: b3h bit name function 7-2 reserved 1 p1m1.1 0: p1.1 is in open drain mode. (default) 1: p1.1 is in quasi-bidirection mode 0 p1m1.0 0: p1.0 is in open drain mode. (default) 1: p1.0 is in quasi-bidirection mode interrupt high priority 0 bit: 7 6 5 4 3 2 1 0 - pch - psh pt1h px1h pt0h px0h mnemonic: ip0h address: b7h bit name function 7 - reserved 6 pch 1: to set interrupt high priority of analog comparator is highest priority level. 5 - reserved. 4 psh 1: to set interrupt high priority of serial port 0 is highest priority level. 3 pt1h 1: to set interrupt high priority of timer 1 is highest priority level. 2 px1h 1: to set interrupt high priority of exte rnal interrupt 1 is highest priority level. 1 pt0h 1: to set interrupt high priority of timer 0 is highest priority level. 0 px0h 1: to set interrupt high priority of exte rnal interrupt 0 is highest priority level. - 28 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 29 - revision a06 interrupt priority 0 bit: 7 6 5 4 3 2 1 0 - pc - ps pt1 px1 pt0 px0 mnemonic: ip0 address: b8h bit name function 7 - this bit is un-implemented and will read high. 6 pc 1: to set interrupt priority of anal og comparator is higher priority level. 5 - this bit is un-implemented and will read high. 4 ps 1: to set interrupt priority of se rial port 0 is higher priority level. 3 pt1 1: to set interrupt priority of timer 1 is higher priority level. 2 px1 1: to set interrupt priority of exter nal interrupt 1 is higher priority level. 1 pt0 1: to set interrupt priority of timer 0 is higher priority level. 0 px0 1: to set interrupt priority of exter nal interrupt 0 is higher priority level. slave address mask enable bit: 7 6 5 4 3 2 1 0 - - - - - - - - mnemonic: saden address: b9h bit name function 7~0 saden this register enables the automatic address recognition feature of the serial port 0. when a bit in the saden is set to 1, the same bit location in saddr will be compared with the incoming serial data. when saden is 0, then the bit becomes a "don't care" in the comparison. this register enables the automatic address recognition feature of the serial port 0. when all the bits of saden are 0, interrupt will occur for any incoming address. nvm byte address bit: 7 6 5 4 3 2 1 0 nvmadd r.7 nvmadd r.6 nvmadd r.5 nvmadd r.4 nvmadd r.3 nvmadd r.2 nvmadd r.1 nvmadd r.0 mnemonic: nvmaddrl address: c6h bit name function 7 nvmaddr.7 must be 0. 6~0 nvmaddr.[6:0] the nvm low byte address: the register indicates nvm data memory address on on-chip code memory space. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 30 - timed access bit: 7 6 5 4 3 2 1 0 ta.7 ta.6 ta.5 ta.4 ta.3 ta.2 ta.1 ta.0 mnemonic: ta address: c7h bit name function 7-0 ta.[7:0] the timed access register: the timed access register controls t he access to protected bits. to access protected bits, the user must first write aah to the ta. this must be immediately followed by a write of 55h to ta. now a window is opened in the protected bits for three machine cycles, during which the user can write to these bits. nvm control bit: 7 6 5 4 3 2 1 0 eer ewr - - - - - - mnemonic: nvmcon address: ceh bit name function 7 eer nvm page(n) erase bit: 0: without erase nvm page(n). 1: set this bit to erase page(n) of nvm. the nvm has 8 pages and each page have 16 bytes data memory. initiate page select by programming nvmaddrl registers, which will automaticly enable page area. when user set this bit, the page erase process will begin and program co unter will halt at this instruction. after the erase process is completed, program counter will continue executing next instruction. 6 ewr nvm data write bit: 0: without write nvm data. 1: set this bit to write nvm bytes and program counter will halt at this instruction. after write is finished, program counter will kept next instru ction then executed. 5-0 - reserved. nvm data bit: 7 6 5 4 3 2 1 0 nvmdat a.7 nvmdat a.6 nvmdat a.5 nvmdat a.4 nvmdat a3 nvmdat a.2 nvmdat a.1 nvmdat a.0 mnemonic: nvmdata address: cfh bit name function 7~0 nvmdata[7:0] the nvm data write register. the read nvm data is by movc instruction. program status word bit: 7 6 5 4 3 2 1 0 cy ac f0 rs1 rs0 ov f1 p www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 31 - revision a06 mnemonic: psw address: d0h bit name function 7 cy carry flag: set for an arithmetic operation which re sults in a carry being generated from the alu. it is also used as the accumulator for the bit operations. 6 ac auxiliary carry: set when the previous operation resulted in a carry from the high order nibble. 5 f0 user flag 0: the general purpose flag that can be set or cleared by the user. 4 rs1 register bank select bits: 3 rs0 register bank select bits: 2 ov overflow flag: set when a carry was generated from the seventh bit but not from the 8 th bit as a result of the previous operation, or vice-versa. 1 f1 user flag 1: the general purpose flag that can be set or cleared by the user by software. 0 p parity flag: set/cleared by hardware to indicate odd/ even number of 1?s in the accumulator. rs.1-0: register bank selection bits: rs1 rs0 register bank address 0 0 0 00-07h 0 1 1 08-0fh 1 0 2 10-17h 1 1 3 18-1fh pwm counter high bits register bit: 7 6 5 4 3 2 1 0 - - - - - - pwmp.9 pwmp.8 mnemonic: pwmph address: d1h bit name function 7-2 - reserved. 1-0 pwmp.[9:8] the pwm counter register bits 9~8. pwm 0 high bits register bit: 7 6 5 4 3 2 1 0 - - - - - - pwm0.9 pwm0.8 mnemonic: pwm0h address: d2h bit name function www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 32 - 7~2 - reserved. 1~0 pwm0.9~8 the pwm 0 register bit 9~8. pwm control register 3 bit: 7 6 5 4 3 2 1 0 - - - pwm0oe - - fp1 fp0 mnemonic: pwmcon3 address: d7h bit name function 7 6 5 4 pwm0oe pwm0 output enable bit. 0: pwm0 output disabled. 1: pwm0 output enabled. if p3.5 is set to high pwm0 will output through p3.5. 3~2 - reserved. 1~0 fp1~0 select pwm frequency pre-scale select bits . the clock source of pre-scaler is in phase with fosc if pwmrun=1, otherwise it is disabled. fp1~0: pwm prescaler select bits: fp[1:0] fpwm 00 fosc 01 fosc/2 10 fosc/4 11 fosc/16 watchdog control bit: 7 6 5 4 3 2 1 0 wdrun - wd1 wd0 wdif wtrf ewrst wdclr mnemonic: wdcon address: d8h bit name function 7 wdrun 0: the watchdog is stopped. 1: the watchdog is running. 6 - reserved. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 33 - revision a06 5~4 wd1~wd0 watchdog timer time-out select bits. these bits determine the time-out period of the watchdog timer. the reset time-o ut period is 512 clocks longer than the watchdog time-out. wd1 wd0 interrupt time- out reset time-out 0 0 2 17 2 17 + 512 0 1 2 20 2 20 + 512 1 0 2 23 2 23 + 512 1 1 2 26 2 26 + 512 3 wdif watchdog timer interrupt flag: 0: if the interrupt is not enabled, then this bit indicates that the time-out period has elapsed. this bit must be cleared by software. 1: if the watchdog interrupt is enabled, hardware will set this bit to indicate that the watchdog interrupt has occurred. 2 wtrf watchdog timer reset flag: 1: hardware will set this bit when the wa tchdog timer causes a reset. software can read it but must clear it manually. a powe r-fail reset will also clear the bit. this bit helps software in determining the cause of a reset. if ewrst = 0, the watchdog timer will have no affect on this bit. 1 ewrst 0: disable watchdog timer reset. 1: enable watchdog timer reset. 0 wdclr reset watchdog timer: this bit helps in putting the watchdog time r into a know state. it also helps in resetting the watchdog timer before a time-out occurs. failing to set the ewrst before time-out will cause an interrupt (if ewdi (eie.4) is set), and 512 clocks after that a watchdog timer reset will be generated (if ewrst is set). this bit is self-clearing by hardware. the wdcon sfr is set to a 0x000000b on a power-on-reset. wtrf (wdcon.2) is set to a 1 on a watchdog timer reset, but to a 0 on power on/down resets. wtrf (wdcon.2) is not altered by an external reset. ewrst (wdcon.1) is set to 0 on all resets. all the bits in this sfr have unrestricted read access. wdrun, ewrst, wdif and wdclr require timed access procedure to write. the re maining bits have unrestricted write accesses. please refer ta register description. ta reg c7h wdcon reg d8h mov ta, #aah ; to access protected bits mov ta, #55h setb wdcon.0 ; reset watchdog timer orl wdcon, #00110000b ; select 26 bits watchdog timer mov ta, #aah mov ta, #55h orl wdcon, #00000010b ; enable watchdog www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 34 - pwm counter low bits register bit: 7 6 5 4 3 2 1 0 pwmp.7 pwmp.6 pwmp.5 pwp.4 pwmp.3 pwmp.2 pwmp.1 pwmp.1 mnemonic: pwmpl address: d9h bit name function 7~0 pwmp pwm counter low bits register. pwm 0 low bits register bit: 7 6 5 4 3 2 1 0 pwm0.7 pwm0.6 pwm0 .5 pwm0.4 pwm0.3 pw m0.2 pwm0.1 pwm0.1 mnemonic: pwm0l address: dah bit name function 7~0 pwm0 pwm 0 low bits register. pwm control register 1 bit: 7 6 5 4 3 2 1 0 pwmrun load pwmf clrpwm - - - pwm0i mnemonic: pwmcon1 address: dch bit name function 7 pwmrun enable pwm running bit 0: the pwm is not running. 1: the pwm counter is running. 6 load enable pwm counter and register re-load 0: the registers value of pwmp and com parators are never loaded to counter and comparator registers. 1: the pwmp register will be load value to counter register after counter underflow and hardware will clear by next clock cycle. 5 pwmf pwm underflow flag. 0: no underflow. 1: pwm 10-bit down counter underflows (p wm interrupt is requested if pwm interrupt is enabled). 4 clrpwm clear pwm counter 1: clear 10-bit pwm counter to 000h. it is automatically cleared by hardware. 3~1 - reserved 0 pwm0i inverse pwm output level 0: pwm0 output is non-inverted. 1: pwm0 output is inverted. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 35 - revision a06 accumulator bit: 7 6 5 4 3 2 1 0 acc.7 acc.6 acc.5 acc.4 acc.3 acc.2 acc.1 acc.0 mnemonic: acc address: e0h bit name function 7-0 acc the a or acc register is the standard 8052 accumulator. interrupt enable register 1 bit: 7 6 5 4 3 2 1 0 - ebov epwm ewdi - - - - mnemonic: eie address: e8h bit name function 7 - reserved. 6 ebov 0: disable brownout interrupt. 1: enable brownout interrupt. 5 epwm 0: disable pwm underflow interrupt. 1: enable pwm underflow interrupt. 4 ewdi 0: disable watchdog timer interrupt. 1: enable watchdog timer interrupt. 3-0 - reserved. b register bit: 7 6 5 4 3 2 1 0 b.7 b.6 b.5 b.4 b.3 b.2 b.1 b.0 mnemonic: b address: f0h bit name function 7-0 b the b register is the standard 8052 r egister that serves as a second accumulator. port comparator input disable bit: 7 6 5 4 3 2 1 0 - - - - - - bit1 bit0 mnemonic: pcmpids address: f6h bit name function 7-2 - reserved 1 pcmpids.1 p1.1 digital input disable bit. 0: default (with digital/analog input). 1: disable digital input of co mparator input 1(negative end) www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 36 - 0 pcmpids.0 p1.0 digital input disable bit. 0: default (with digital/analog input). 1: disable digital input of co mparator input 1(positive end) interrupt high priority 1 bit: 7 6 5 4 3 2 1 0 - pbovh ppwmh pwdih - - - - mnemonic: ip1h address: f7h bit name function 7 - reserved. 6 pbovh 1: to set interrupt priority of brow nout interrupt is highest priority level. 5 ppwmh 1: to set interrupt priority of pwm underflow is highest priority level. 4 pwdih 1: to set interrupt high priority of watchdog is highest priority level. 3-0 - reserved. extended interrupt priority bit: 7 6 5 4 3 2 1 0 - pbov ppwm pwdi - - - - mnemonic: ip1 address: f8h bit name function 7 - reserved. 6 pbov 1: to set interrupt priority of brow nout interrupt is higher priority level. 5 ppwm 1: to set interrupt priority of pwm underflow is higher priority level. 4 pwdi 1: to set interrupt priority of watchdog is higher priority level. 3-0 - reserved. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 37 - revision a06 9 instruction the w79e4051/2051 series execute a ll the instructions of the standar d 8052 family. the operations of these instructions, as well as their effects on fl ag and status bits, are exactly same. however, the timing of these instructions is different in two ways . firstly, the machine cycle is four clock periods, while the standard-8051/52 machine cycle is twelve cl ock periods. secondly, it can fetch only once per machine cycle (i.e., four clocks per fetch), while the standard 8051/52 can fetch twice per machine cycle (i.e., six clocks per fetch). the timing differences create an advantage for t he w79e4051/2051 series. there is only one fetch per machine cycle, so the number of machine cycles is usually equal to the number of operands in the instruction. (jumps and calls do require an additional cycle to calculate the new address.) as a result, the w79e4051/2051 series reduces the number of dummy fetches and wasted cycles, and therefore improves overall efficiency, compared to the standard 8051/52. op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio nop 00 1 1 4 12 3 add a, r0 28 1 1 4 12 3 add a, r1 29 1 1 4 12 3 add a, r2 2a 1 1 4 12 3 add a, r3 2b 1 1 4 12 3 add a, r4 2c 1 1 4 12 3 add a, r5 2d 1 1 4 12 3 add a, r6 2e 1 1 4 12 3 add a, r7 2f 1 1 4 12 3 add a, @r0 26 1 1 4 12 3 add a, @r1 27 1 1 4 12 3 add a, direct 25 2 2 8 12 1.5 add a, #data 24 2 2 8 12 1.5 addc a, r0 38 1 1 4 12 3 addc a, r1 39 1 1 4 12 3 addc a, r2 3a 1 1 4 12 3 addc a, r3 3b 1 1 4 12 3 addc a, r4 3c 1 1 4 12 3 addc a, r5 3d 1 1 4 12 3 addc a, r6 3e 1 1 4 12 3 addc a, r7 3f 1 1 4 12 3 addc a, @r0 36 1 1 4 12 3 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 38 - op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio addc a, @r1 37 1 1 4 12 3 addc a, direct 35 2 2 8 12 1.5 addc a, #data 34 2 2 8 12 1.5 subb a, r0 98 1 1 4 12 3 subb a, r1 99 1 1 4 12 3 subb a, r2 9a 1 1 4 12 3 subb a, r3 9b 1 1 4 12 3 subb a, r4 9c 1 1 4 12 3 subb a, r5 9d 1 1 4 12 3 subb a, r6 9e 1 1 4 12 3 subb a, r7 9f 1 1 4 12 3 subb a, @r0 96 1 1 4 12 3 subb a, @r1 97 1 1 4 12 3 subb a, direct 95 2 2 8 12 1.5 subb a, #data 94 2 2 8 12 1.5 inc a 04 1 1 4 12 3 inc r0 08 1 1 4 12 3 inc r1 09 1 1 4 12 3 inc r2 0a 1 1 4 12 3 inc r3 0b 1 1 4 12 3 inc r4 0c 1 1 4 12 3 inc r5 0d 1 1 4 12 3 inc r6 0e 1 1 4 12 3 inc r7 0f 1 1 4 12 3 inc @r0 06 1 1 4 12 3 inc @r1 07 1 1 4 12 3 inc direct 05 2 2 8 12 1.5 inc dptr a3 1 2 8 24 3 dec a 14 1 1 4 12 3 dec r0 18 1 1 4 12 3 dec r1 19 1 1 4 12 3 dec r2 1a 1 1 4 12 3 dec r3 1b 1 1 4 12 3 dec r4 1c 1 1 4 12 3 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 39 - revision a06 op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio dec r5 1d 1 1 4 12 3 dec r6 1e 1 1 4 12 3 dec r7 1f 1 1 4 12 3 dec @r0 16 1 1 4 12 3 dec @r1 17 1 1 4 12 3 dec direct 15 2 2 8 12 1.5 mul ab a4 1 5 20 48 2.4 div ab 84 1 5 20 48 2.4 da a d4 1 1 4 12 3 anl a, r0 58 1 1 4 12 3 anl a, r1 59 1 1 4 12 3 anl a, r2 5a 1 1 4 12 3 anl a, r3 5b 1 1 4 12 3 anl a, r4 5c 1 1 4 12 3 anl a, r5 5d 1 1 4 12 3 anl a, r6 5e 1 1 4 12 3 anl a, r7 5f 1 1 4 12 3 anl a, @r0 56 1 1 4 12 3 anl a, @r1 57 1 1 4 12 3 anl a, direct 55 2 2 8 12 1.5 anl a, #data 54 2 2 8 12 1.5 anl direct, a 52 2 2 8 12 1.5 anl direct, #data 53 3 3 12 24 2 orl a, r0 48 1 1 4 12 3 orl a, r1 49 1 1 4 12 3 orl a, r2 4a 1 1 4 12 3 orl a, r3 4b 1 1 4 12 3 orl a, r4 4c 1 1 4 12 3 orl a, r5 4d 1 1 4 12 3 orl a, r6 4e 1 1 4 12 3 orl a, r7 4f 1 1 4 12 3 orl a, @r0 46 1 1 4 12 3 orl a, @r1 47 1 1 4 12 3 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 40 - op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio orl a, direct 45 2 2 8 12 1.5 orl a, #data 44 2 2 8 12 1.5 orl direct, a 42 2 2 8 12 1.5 orl direct, #data 43 3 3 12 24 2 xrl a, r0 68 1 1 4 12 3 xrl a, r1 69 1 1 4 12 3 xrl a, r2 6a 1 1 4 12 3 xrl a, r3 6b 1 1 4 12 3 xrl a, r4 6c 1 1 4 12 3 xrl a, r5 6d 1 1 4 12 3 xrl a, r6 6e 1 1 4 12 3 xrl a, r7 6f 1 1 4 12 3 xrl a, @r0 66 1 1 4 12 3 xrl a, @r1 67 1 1 4 12 3 xrl a, direct 65 2 2 8 12 1.5 xrl a, #data 64 2 2 8 12 1.5 xrl direct, a 62 2 2 8 12 1.5 xrl direct, #data 63 3 3 12 24 2 clr a e4 1 1 4 12 3 cpl a f4 1 1 4 12 3 rl a 23 1 1 4 12 3 rlc a 33 1 1 4 12 3 rr a 03 1 1 4 12 3 rrc a 13 1 1 4 12 3 swap a c4 1 1 4 12 3 mov a, r0 e8 1 1 4 12 3 mov a, r1 e9 1 1 4 12 3 mov a, r2 ea 1 1 4 12 3 mov a, r3 eb 1 1 4 12 3 mov a, r4 ec 1 1 4 12 3 mov a, r5 ed 1 1 4 12 3 mov a, r6 ee 1 1 4 12 3 mov a, r7 ef 1 1 4 12 3 mov a, @r0 e6 1 1 4 12 3 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 41 - revision a06 op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio mov a, @r1 e7 1 1 4 12 3 mov a, direct e5 2 2 8 12 1.5 mov a, #data 74 2 2 8 12 1.5 mov r0, a f8 1 1 4 12 3 mov r1, a f9 1 1 4 12 3 mov r2, a fa 1 1 4 12 3 mov r3, a fb 1 1 4 12 3 mov r4, a fc 1 1 4 12 3 mov r5, a fd 1 1 4 12 3 mov r6, a fe 1 1 4 12 3 mov r7, a ff 1 1 4 12 3 mov r0, direct a8 2 2 8 12 1.5 mov r1, direct a9 2 2 8 12 1.5 mov r2, direct aa 2 2 8 12 1.5 mov r3, direct ab 2 2 8 12 1.5 mov r4, direct ac 2 2 8 12 1.5 mov r5, direct ad 2 2 8 12 1.5 mov r6, direct ae 2 2 8 12 1.5 mov r7, direct af 2 2 8 12 1.5 mov r0, #data 78 2 2 8 12 1.5 mov r1, #data 79 2 2 8 12 1.5 mov r2, #data 7a 2 2 8 12 1.5 mov r3, #data 7b 2 2 8 12 1.5 mov r4, #data 7c 2 2 8 12 1.5 mov r5, #data 7d 2 2 8 12 1.5 mov r6, #data 7e 2 2 8 12 1.5 mov r7, #data 7f 2 2 8 12 1.5 mov @r0, a f6 1 1 4 12 3 mov @r1, a f7 1 1 4 12 3 mov @r0, direct a6 2 2 8 12 1.5 mov @r1, direct a7 2 2 8 12 1.5 mov @r0, #data 76 2 2 8 12 1.5 mov @r1, #data 77 2 2 8 12 1.5 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 42 - op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio mov direct, a f5 2 2 8 12 1.5 mov direct, r0 88 2 2 8 12 1.5 mov direct, r1 89 2 2 8 12 1.5 mov direct, r2 8a 2 2 8 12 1.5 mov direct, r3 8b 2 2 8 12 1.5 mov direct, r4 8c 2 2 8 12 1.5 mov direct, r5 8d 2 2 8 12 1.5 mov direct, r6 8e 2 2 8 12 1.5 mov direct, r7 8f 2 2 8 12 1.5 mov direct, @r0 86 2 2 8 12 1.5 mov direct, @r1 87 2 2 8 12 1.5 mov direct, direct 85 3 3 12 24 2 mov direct, #data 75 3 3 12 24 2 mov dptr, #data 16 90 3 3 12 24 2 movc a, @a+dptr 93 1 2 8 24 3 movc a, @a+pc 83 1 2 8 24 3 movx a, @r0 e2 1 2 - 9 8 - 36 24 3 - 0.66 movx a, @r1 e3 1 2 - 9 8 - 36 24 3 - 0.66 movx a, @dptr e0 1 2 - 9 8 - 36 24 3 - 0.66 movx @r0, a f2 1 2 - 9 8 - 36 24 3 - 0.66 movx @r1, a f3 1 2 - 9 8 - 36 24 3 - 0.66 movx @dptr, a f0 1 2 - 9 8 - 36 24 3 - 0.66 push direct c0 2 2 8 24 3 pop direct d0 2 2 8 24 3 xch a, r0 c8 1 1 4 12 3 xch a, r1 c9 1 1 4 12 3 xch a, r2 ca 1 1 4 12 3 xch a, r3 cb 1 1 4 12 3 xch a, r4 cc 1 1 4 12 3 xch a, r5 cd 1 1 4 12 3 xch a, r6 ce 1 1 4 12 3 xch a, r7 cf 1 1 4 12 3 xch a, @r0 c6 1 1 4 12 3 xch a, @r1 c7 1 1 4 12 3 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 43 - revision a06 op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio xchd a, @r0 d6 1 1 4 12 3 xchd a, @r1 d7 1 1 4 12 3 xch a, direct c5 2 2 8 12 1.5 clr c c3 1 1 4 12 3 clr bit c2 2 2 8 12 1.5 setb c d3 1 1 4 12 3 setb bit d2 2 2 8 12 1.5 cpl c b3 1 1 4 12 3 cpl bit b2 2 2 8 12 1.5 anl c, bit 82 2 2 8 24 3 anl c, /bit b0 2 2 6 24 3 orl c, bit 72 2 2 8 24 3 orl c, /bit a0 2 2 6 24 3 mov c, bit a2 2 2 8 12 1.5 mov bit, c 92 2 2 8 24 3 acall addr11 71, 91, b1, 11, 31, 51, d1, f1 2 3 12 24 2 lcall addr16 12 3 4 16 24 1.5 ret 22 1 2 8 24 3 reti 32 1 2 8 24 3 ajmp addr11 01, 21, 41, 61, 81, a1, c1, e1 2 3 12 24 2 ljmp addr16 02 3 4 16 24 1.5 jmp @a+dptr 73 1 2 6 24 3 sjmp rel 80 2 3 12 24 2 jz rel 60 2 3 12 24 2 jnz rel 70 2 3 12 24 2 jc rel 40 2 3 12 24 2 jnc rel 50 2 3 12 24 2 jb bit, rel 20 3 4 16 24 1.5 jnb bit, rel 30 3 4 16 24 1.5 jbc bit, rel 10 3 4 16 24 1.5 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 44 - op-code hex code bytes w79e4051 /2051 series machine cycle w79e4051 /2051 series clock cycles 8032 clock cycles w79e4051/205 1 series vs. 8032 speed ratio cjne a, direct, rel b5 3 4 16 24 1.5 cjne a, #data, rel b4 3 4 16 24 1.5 cjne @r0, #data, rel b6 3 4 16 24 1.5 cjne @r1, #data, rel b7 3 4 16 24 1.5 cjne r0, #data, rel b8 3 4 16 24 1.5 cjne r1, #data, rel b9 3 4 16 24 1.5 cjne r2, #data, rel ba 3 4 16 24 1.5 cjne r3, #data, rel bb 3 4 16 24 1.5 cjne r4, #data, rel bc 3 4 16 24 1.5 cjne r5, #data, rel bd 3 4 16 24 1.5 cjne r6, #data, rel be 3 4 16 24 1.5 cjne r7, #data, rel bf 3 4 16 24 1.5 djnz r0, rel d8 2 3 12 24 2 djnz r1, rel d9 2 3 12 24 2 djnz r5, rel dd 2 3 12 24 2 djnz r2, rel da 2 3 12 24 2 djnz r3, rel db 2 3 12 24 2 djnz r4, rel dc 2 3 12 24 2 djnz r6, rel de 2 3 12 24 2 djnz r7, rel df 2 3 12 24 2 djnz direct, rel d5 3 4 16 24 1.5 table 9-1: instruction set for w79e4051/2051 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 45 - revision a06 9.1 instruction timing in w79e4051/2051 series, each machine cycle is four clock periods long. each clock period is called a state, and each machine cycle consists of four st ates: c1, c2 c3 and c4, in order. both clock edges are used for internal timing, so the duty cycle of t he clock should be as close to 50% as possible to avoid timing conflicts. the w79e4051/2051 series does one op-code fetch per machine cycle, so, in most instructions, the number of machine cycles required is equal to the nu mber of bytes in the instruction. there are 256 available op-codes. 128 of them are single-cycle in structions, so many op-codes are executed in just four clocks period. some of the other op-codes ar e two-cycle instructions, and most of these have two-byte op-codes. however, there are some instructions that have one-byte instructions yet take two cycles to execute. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 10 power management the w79e4051/2051 series has several features that help the user to control the power consumption of the device. these modes are discussed in the next two sections. 10.1 idle mode the user can put the device into idle mode by writing 1 to the bit pcon.0. the instruction that sets the idle bit is the last instruction t hat will be executed before the device goes into idle mode. in the idle mode, the clock to the cpu is halte d, but not to the interrupt, time r, watchdog timer, pwm, analog comparator(cipe=1) and serial port blocks. this forces the cpu state to be frozen; the program counter, the stack pointer, the program status word, the accumulator and the other registers hold their contents. the port pins hold the logical states they had at the time idle was activated. the idle mode can be terminated in two ways. since the interr upt controller is still active, the activation of any enabled interrupt can wake up the processor. this will automatically clear the idle bit, terminate the idle mode, and the interrupt serv ice routine (isr) will be executed. after the isr, execution of the program will continue from the instructio n which put the device into idle mode. the idle mode can also be exited by activating the reset. the device can put into reset either by applying a high on the external rst pin, a power on reset condition or a watchdog timer reset. the external reset pin has to be held high for at leas t two machine cycles i.e. 8 clock periods to be recognized as a valid reset. in the reset condition the program counter is reset to 0000h and all the sfrs are set to the reset condition. since the cloc k is already running there is no delay and execution starts immediately. in the idle mode, the watch dog timer continues to run, and if enabled, a time-out will cause a watchdog timer interrupt which will wa ke up the device. the software must reset the watchdog timer in order to preempt the reset which will occur after 512 clock periods of the time-out. when the w79e4051/2051 series are exiting from an idle mode with a reset, the instruction following the one which put the device into idle mode is not executed. so there is no danger of unexpected writes. p1.0 and p1.1 should be set to 1 if external pull-ups are applied, or set to 0 if without external pull-ups, or configured to quasi i/o mode by setting p1m1 bit0 and bit1 to high. 10.2 power down mode the device can be put into power down mode by writ ing 1 to bit pcon.1. the instruction that does this will be the last instruction to be executed before the device goes into power down mode. in the power down mode, all the clocks are stopped and the device comes to a halt. all activity, exception of brownout reset, 1int , 0int , watchdog timer(config0.wdtck=0) and analog comparator(cipe=1), is completely stopped and the power consumption is reduced to the lowest possible value. the port pins output the values held by their respective sfrs. before cpu enters power-down mode, p1.0 and p1.1 should be set to 1 if external pull-ups are applied, or set to 0 if without external pull-ups, or configured to quasi i/o mode by setting p1m1 bit0 and bit1 to high. an external reset can be used to exit the powe r down state. the high on rst pin terminates the power down mode, and restarts the clock. the pr ogram execution will restart from 0000h. in the power down mode, the clock is stopped, so the watc hdog timer cannot be used to provide the reset to exit power down mode when its clock s ource is external osc or crystal. the sources that can wake up from the power down mode are external interrupts, brownout reset (bor), watchdog timer interrupt (if config0 bit wdtck = 0) and analog comparator(if sfr bit - 46 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet cipe=1). the w79e4051/2051 series can be waken up from the power down mode by forcing the above sources activation, provided the corresponding interrupt is enabled, while the global enable (ea) bit is set. if these conditions are met, then inte rrupt event will re-start the oscillator. the device will then execute the interrupt se rvice routine for the correspondi ng external interrupt. after the interrupt service routine is comple ted, the program execution returns to the instruction after one which put the device into power down mode and continue s from there. during power down mode, if auxr1.lpbov = 1 and auxr1.bod = 0, the internal rc clock will be enabled and hence save power. in w79e4051/2051 series either a low-level or a falling-edge at external interrupt pin, 1int or 0int will re-start the oscillator. w79e4051/2051 provides 3 wake-up modes, selected by sfr bits pwdex1 and pwdex0, that the external interrupt pins can terminate power-down mode. refer to the table below. pwdex[1:0] trigger type function to terminate power-down mode 0, 0 (mode1) low-level 0, 1 (mode2) low-level 1, x (mode3) low-level and falling- edge in mode1 and mode2, the external interrupt pin must keep low longer than tpd otherwise cpu stays in power-down mode continuously. tpd is about 2ms counted by built-in rc oscillator. publication release date: april 16, 2009 - 47 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 48 - 11 reset conditions the user has several hardware related options for placing the w79e4051/2051 series into reset condition. in general, most register bits go to their reset value irrespective of the reset condition, but there are a few flags whose state depends on the sour ce of reset. the user can use these flags to determine the cause of reset using software. 11.1 sources of reset 11.1.1 external reset the device samples the rst pin every machine cycl e during state c4. the rst pin must be held high for at least two machine cycles before the reset ci rcuitry applies an internal reset signal. thus, this reset is a synchronous operation and requires the clock to be running. the device remains in the reset state as long as rst pin is high and remains high up to two machine cycles after rst is deactivated. then, the device begins program ex ecution at 0000h. there are no flags associated with the external reset, but, si nce the other two reset sources do have flags, the external reset is the cause if those flags are clear. 11.1.2 power-on reset (por) if the power supply falls below v rst , the device goes into the rese t state. when the power supply returns to proper levels, the device performs a po wer-on reset and sets the por flag. the software should clear the por flag, or it will be difficult to determine the source of future resets. v rst is about 2.0v. 11.1.3 brown-out reset (bor) if the power supply falls below brownout voltage of v bov , the device goes into the reset state. when the power supply returns to proper levels, the device performs a brownout reset. 11.1.4 watchdog timer reset the watchdog timer is a free-running timer with programmable time-out intervals. the program must clear the watchdog timer before the time-out interval is reached to restart the count. if the time-out interval is reached, an interrupt flag is set. 512 cloc ks later, if the watchdog reset is enabled and the watchdog timer has not been cleared, the watchdog timer generates a reset. the reset condition is maintained by the hardware for two machine cycles , and the wtrf bit in wdcon is set. afterwards, the device begins program execution at 0000h. 11.2 reset state when the device is reset, most registers return to th eir initial state. the watchdog timer is disabled if the reset source was a power-on reset. the port regi sters are set to ffh, which puts most of the port pins in a high state. the program counter is set to 0000h, and the stack pointer is reset to 07h. after this, the device remains in the reset state as long as the reset conditions are satisfied. reset does not affect the on-chip ram, however, so ram is preserved as long as vdd remains above approximately 2v, the minimum operating volt age for the ram. if vdd falls below 2v, the ram contents are also lost. in either case, the stack point er is always reset, so the stack contents are lost. the wdcon sfr bits are set/cleared in reset condition depending on the source of the reset. the wdcon sfr is set to a 0x00 0000b on the reset. wtrf (wdcon.2) is set to a 1 on a watchdog timer reset, but to a 0 on power on/down resets. wtrf (wdcon.2) is not altered by external reset. ewrst (wdcon.1) is cleared by any reset. software or any reset will clear wdif (wdcon.3) bit. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet some of the bits in the wdcon sfr (wdrun , wdclr, ewrst, wdif, wd0 and wd1) have unrestricted read access which required timed acce ss procedure to write. the remaining bits have unrestricted write accesses. please refer ta register description. system status system in reset system normal run wdg rst wdg stop wdg normal run vdd power 512 watchdog timer clocks crystal 65536 clocks internal rc 256 clocks v bo3.8 (bor enable) v bo3.8 (bor enable) v bo3.8 2 watchdog timer clocks crystal 65536 clocks internal rc 256 clocks system in reset figure 11-1: internal reset and vdd monitor timing diagram publication release date: april 16, 2009 - 49 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet system status system in reset system normal run external rst pin vdd power 0.3vdd crystal 65536 clocks internal rc 256 clocks system within power down mode system not in power down mode at least 4 clocks v bo3.8 (bor enable) crystal 65536 clocks internal rc 256 clocks system in reset 0.7vdd figure 11-2: external reset timing diagram - 50 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 12 interrupts the w79e4051/2051 series have 9 interrupts source that are ie0, bof, wdif, tf0, cf, ie1, tf1, ti+ri and pwmf . each of the interrupt sources has an individual priority bit, flag, interrupt vector and enable bit. in addition, the interrupts can be globally enabled or disabled. if an external interrupt is requested when the w79e4 051/2051 series are put into power down or idle mode, the interrupt will cause the processor to wake up and resume operation. 12.1 interrupt sources the external interrupts int0 and int1 can be either edge triggered or level triggered, programmable through bits it0 and it1. the bits ie0 and ie1 in the tcon register are the fl ags which are checked to generate the interrupt. in the edge triggered mode, the intx inputs are sampled in every machine cycle. if the sample is high in one cycle and low in the next, then a high to low transition is detected and the interrupts request flag iex in tcon is set. the flag bit requests the interrupt. since the external interrupts are sampled every machine cycle, they have to be held high or low for at least one complete machine cycle. the iex flag is automatically cleared when the service routine is called. if the level triggered mode is selected, then the requesting source has to hold the pin low till the interrupt is serviced. the iex flag will not be cleared by the hardware on entering the service routine. if the interrupt continues to be held low even after the serv ice routine is completed, then the processor may acknowledge another interrupt request from the same source. the timer 0 and 1 interrupts are generated by the tf0 and tf1 flags. these flags are set by the overflow in the timer 0 and timer 1. the tf0 and tf1 flags are automatically cleared by the hardware when the timer interrupt is serviced. the watchdog timer can be used as a system monitor or a simple timer. in either case, when the time-out count is reached, the watchdog timer interrupt flag wdif (wdcon.3) is set. if the interrupt is enabled by t he enable bit eie.4, then an interrupt will occur. pwm interrupt is generated when its? 10-bit down counter underflows. pwmf flag is set and pwm interrupt is generated if enabled. pwmf is set by hardware and can only be cleared by software. the comparator can generate interrupt after comparator output has occurs by cf flag. this bit is not automatically cleared by the hardw are, and the user will have to clear this bit using software. the serial block can generate interrupt on reception or transmission. there are two interrupt sources from the serial block, which are obtained by the ri and ti bits in the scon sfr. these bits are not automatically cleared by the hardw are, and the user will have to cl ear these bits using software. brownout detect can cause brownout flag, bof, to be asserted if power voltage drop below brownout voltage level. interrupt will occur if boi (auxr1.5 ), ebov (eie.6) and global interrupt enable are set. all the bits that generate interrupts can be set or reset by software, and thereby software initiated interrupts can be generated. each of the individual interrupts can be enabled or disabled by setting or clearing a bit in the ie sfr. ie also has a gl obal enable/disable bit ea, which can be cleared to disable all interrupts. publication release date: april 16, 2009 - 51 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 52 - the interrupt flags are sampled every machine cycle. in the same machine cycle, the sampled interrupts are polled and their priority is resolved. if certain conditions are met then the hardware will execute an internally generated lcal l instruction which will vector the process to the appropriate interrupt vector address. the conditions for generating the lcall are; 1. an interrupt of equal or higher prio rity is not current ly being serviced. 2. the current polling cycle is the last machine cycle of the instruction currently being execute. 3. the current instruction does not involve a writ e to ie, ip and iph, registers and is not a reti. if any of these conditions are not met, then the lcall will not be generated. the polling cycle is repeated every machine cycle, with the interrupts samp led in the same machine cycle. if an interrupt flag is active in one cycle but not responded to, and is not active when the above conditions are met, the denied interrupt will not be serviced. this means that active interrupts are not remembered; every polling cycle is new. the processor responds to a valid interrupt by executing an lcall instruction to the appropriate service routine. this may or may not clear the flag which caused the interrupt. in case of timer interrupts, the tf0 or tf1 flags are cleared by hardware whenever the processor vectors to the appropriate timer service routine. in case of external interrupt, int0 and int1, the flags are cleared only if they are edge triggered. in case of serial in terrupts, the flags are not cleared by hardware. the hardware lcall behaves exactly like the software lc all instruction. this instruction saves the program counter contents onto the stack, but does not save the program status word psw. the pc is reloaded with the vector address of that interrupt which caused the lcall. these address of vector for the different sources are as follows: vector locations for interrupt sources s ource v ector address s ource v ector address external interrupt 0 0003h timer 0 overflow 000bh external interrupt 1 0013h timer 1 overflow 001bh serial port 0023h brownout interrupt 002bh analog comparator 0033h - 003bh - 0043h - 004bh watchdog timer 0053h - 005bh - 0063h pwm period interrupt 006bh table 12-1: vector locations for interrupt sources execution continues from the vect ored address till an reti instructi on is executed. on execution of the reti instruction the pr ocessor pops the stack and loads the pc with the contents at the top of the stack. the user must take care that the status of the stac k is restored to what it was after the hardware lcall, if the execution is return to the interr upted program. the processor does not notice anything if the stack contents are modified and will proceed wi th execution from the address put back into pc. note that a ret instruction would perform exactly the same process as a re ti instruction, but it would not inform the interrupt controller that the interrupt service routine is completed, and would leave the controller still thinking that the service rout ine is underway. 12.2 priority level structure www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 53 - revision a06 the w79e4051/2051 series uses a four priority level interrupt structure (highest, high, low and lowest) and supports up to 9 interrupt sources. the interrupt sources can be individually set to either high or low levels. naturally, a higher priority interrupt c annot be interrupted by a lower priority interrupt. however there exists a pre-defined hierarchy among st the interrupts themselves. this hierarchy comes into play when the interrupt controller ha s to resolve simultaneous requests having the same priority level. this hier archy is defined as table below. this a llows great flexibility in controlling and handling many interrupt sources. priority bits ipxh ipx interrupt priority level 0 0 level 0 (lowest priority) 0 1 level 1 1 0 level 2 1 1 level 3 (highest priority) table 12-2: four-level interrupt priority each interrupt source can be individually programm ed to one of four priority levels by setting or clearing bits in the ipx and ipxh registers. an inte rrupt service routine in progress can be interrupted by a higher priority interrupt, but not by another in terrupt of the same or lower priority. the highest priority interrupt service cannot be interrupted by any other interrupt source. so, if two requests of different priority levels are received simultaneously, the request of higher priority level is serviced. if requests of the same priority level are received simultaneously, an internal polling sequence determines which request is serviced. this is called the arbitration ranking. note that the arbitration ranking is only used to resolve simultaneous requests of the same priority level. as below table summarizes the interrupt sources, flag bits, vector addresses, enable bits, priority bits, arbitration ranking, and whether each interrupt may wake up the cpu from power down mode. source flag vector address interrupt enable bits interrupt priority flag cleared by arbitration ranking power down wakeup external interrupt 0 ie0 0003h ex0 (ie0.0) ip0h.0, ip0.0 edge: hardware, software; level: follow the inverse of pin 1(highest) yes brownout detect bof 002bh ebov (eie.6) ip1h.6, ip1.6 software 2 yes watchdog timer wdif 0053h ewdi (eie.4) ip1h.4, ip1.4 software 3 yes (1) timer 0 interrupt tf0 000bh et0 (ie.1) ip0h.1, ip0.1 hardware, software 4 no external interrupt 1 ie1 0013h ex1 (ie.2) ip0h.2, ip0.2 edge: hardware, software; level: 5 yes www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet follow the inverse of pin timer 1 interrupt tf1 001bh et1 (ie.3) ip0h.3, ip0.3 hardware, software 6 no serial port tx and rx ti & ri 0023h es (ie.4) ip0h.4, ip0.4 software 7 no comparator interrupt cf 0033h ec (ie.6) ip0h.6, ip0.6 software 8 yes (2) pwm period interrupt pwmf 006bh epwm (eie.5) ip1h.5, ip1.5 software 9(lowest) no table 12-3: vector location for interrupt sources and power down wakeup note: 1. the watchdog timer can wake up power down mode when its clock source is from internal rc. 2. the comparator can wake up power down mode when bit acsr.5(cipe) is set to high. 12.3 response time the response time for each interrupt source depend s on several factors, such as the nature of the interrupt and the instruction underway. in the case of external interrupts int0 to ri+ti, they are sampled at c3 of every machine cycle and then t heir corresponding interrupt flags iex will be set or reset. the timer 0 and 1 overflow flags are set at c3 of the machine cycle in which overflow has occurred. these flag values are polled only in the next machine cycle. if a request is active and all three conditions are met, then the hardware generat ed lcall is executed. this lcall itself takes four machine cycles to be completed. thus there is a minimum time of five machine cycles between the interrupt flag being set and the inte rrupt service routine being executed. a longer response time should be anticipated if any of the three conditions are not met. if a higher or equal priority is being serviced, then the interrupt latency time obviously depends on the nature of the service routine currently being executed. if the po lling cycle is not the last machine cycle of the instruction being executed, then an additional delay is introduced. the maximum response time (if no other interrupt is in service) occurs if the w79e 4051/2051 series are performing a write to ie, ip and iph and then executes a mul or div in struction. from the time an inte rrupt source is activated, the longest reaction time is 12 machine cycles. this includes 1 machine cycle to detect the interrupt, 2 machine cycles to complete the ie, ip or iph access, 5 machine cycles to complete the mul or div instruction and 4 machine cycles to complete the hardware lcall to the interrupt vector location. thus in a single-interrupt system the interrupt response time will always be more than 5 machine cycles and not more than 12 machine cycles. the ma ximum latency of 12 machine cycles is 48 clock cycles. note that in the standard 8051 the maxi mum latency is 8 machine cycles which equals 96 machine cycles. this is a 50% reduction in terms of clock periods. - 54 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 13 programmable timers/counters the w79e4051/2051 series have two 16-bit programmable timer/counters and one programmable watchdog timer. the watchdog timer is operationally quite different from the other two timers. 13.1 timer/counters 0 & 1 w79e4051/2051 has two 16-bit timer/counters. each of these timer/counters has two 8 bit registers which form the 16 bit counting register. for timer/c ounter 0 they are th0, the upper 8 bits register, and tl0, the lower 8 bit register. similarly timer/co unter 1 has two 8 bit registers, th1 and tl1. the two can be configured to operate either as timers , counting machine cycles or as counters counting external inputs. when configured as a "timer", the timer counts clock cycles. the timer clock can be programmed to be thought of as 1/12 of the system clock or 1/6 of the system clock. in the "counter" mode, the register is incremented on the falling edge of the exter nal input pin, t0 in case of timer 0, and t1 for timer 1. the t0 and t1 inputs are sampled in every machine cycle at c4. if the sampled value is high in one machine cycle and low in the next, then a valid high to low transition on the pin is recognized and the count register is incremented. since it takes two machine cycles to recognize a negative transition on the pin, the maximum ra te at which counting will take pl ace is 1/24 of the master clock frequency. in either the "timer" or "counter" mode, the count register will be updated at c3. therefore, in the "timer" mode, the recognized negative transition on pin t0 and t1 can cause the count register value to be updated only in the ma chine cycle following the one in which the negative edge was detected. the "timer" or "counter" function is selected by the " tc/ " bit in the tmod special function register. each timer/counter has one selection bit for it s own; bit 2 of tmod selects the function for timer/counter 0 and bit 6 of tmod selects the f unction for timer/counter 1. in addition each timer/counter can be set to operate in any one of four possible modes. the mode selection is done by bits m0 and m1 in the tmod sfr. 13.2 time-base selection w79e4051/2051 provides users with two modes of operation for the timer. the timers can be programmed to operate like the standard 8051 family, count ing at the rate of 1/12 of the clock speed. this will ensure that timing loops on w79e4051/2051 and the standard 8051 can be matched. this is the default mode of operation of the w79e4051/2051 time rs. the user also has the option to count in the 2-times mode, where the timers will increment at the rate of 1/6 clock speed. this will straight- away increase the counting speed three times. this selection is done by the t0m and t1m bit in ckcon sfr. a reset sets these bits to 0, and t he timers then operate in the standard 8051 mode. the user should set these bits to 1 if the timers are to operate in turbo mode. 13.2.1 mode 0 in mode 0, the timer/counter is a 13-bit counter. the 13-bit counter consists of thx (8 msb) and the five lower bits of tlx (5 lsb). the upper three bits of tlx are ignored. the timer/counter is enabled when trx is set and either gate is 0 or intx is 1. when tc / is 0, the timer/counter counts clock cycles; when tc / is 1, it counts falling edges on t0 (timer 0) or t1 (timer 1). for clock cycles, the time base may be 1/12 or 1/6 clock speed, and the falling edge of the clock increments the counter. when the 13-bit value moves from 1fffh to 0000h, the timer overflow flag tfx is set, and an interrupt occurs if enabled. this is illustrated in next figure below. publication release date: april 16, 2009 - 55 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 0 1 047 07 tfx th0 (th1) tl0 (tl1) timer/counter 0/1 mode 0 interrupt t0=p3.4 (c/t =tmod.6) c/t =tmod.2 gate=tmod.3 (gate=tmod.7) /int0=p3.2 (/int1=p3.3) (t1=p3.5) tf0 (tf1) tr0=tcon.4 tr1=tcon.6 1/12 1/6 fosc 1 0 t0m=ckcon.3 (t1m=ckcon.4) figure 13-1: timer/counters 0 & 1 in mode 0 13.2.2 mode 1 mode 1 is similar to mode 0 except that the counting register forms a 16-bit counter, rather than a 13- bit counter. this means that all the bits of thx and tlx are used. roll-over occurs when the timer moves from a count of ffffh to 0000h. the timer overfl ow flag tfx of the relevant timer is set and if enabled an interrupt will occur. the selection of the ti me-base in the timer mode is similar to that in mode 0. the gate function operates similarly to that in mode 0. 0 1 047 07 tfx th0 (th1) tl0 (tl1) timer/counter 0/1 mode 1 interrupt t0=p3.4 (c/t =tmod.6) c/t =tmod.2 gate=tmod.3 (gate=tmod.7) /int0=p3.2 (/int1=p3.3) (t1=p3.5) tf0 (tf1) tr0=tcon.4 tr1=tcon.6 1/12 1/6 fosc 1 0 t0m=ckcon.3 (t1m=ckcon.4) figure 13-2: timer/counters 0 & 1 in mode 1 13.2.3 mode 2 in mode 2, the timer/counter is in the auto reload mode. in this mode, tlx acts as an 8-bit count register, while thx holds the reload value. when th e tlx register overflows from ffh to 00h, the tfx bit in tcon is set and tlx is reloaded with the contents of thx, and the c ounting process continues from here. the reload operation leaves the cont ents of the thx register unchanged. counting is enabled by the trx bit and proper setting of gate and intx pins. as in the other two modes 0 and 1 mode 2 allows counting of either clock cycles (clock/12 or clock/6) or pulses on pin tn. - 56 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 0 1 07 07 tfx th0 (th1) tl0 (tl1) interrupt t0=p3.4 (c/t =tmod.6) c/t =tmod.2 gate=tmod.3 (gate=tmod.7) /int0=p3.2 (/int1=p3.3) (t1=p3.5) tf0 (tf1) tr0=tcon.4 tr1=tcon.6 fcpu 1/6 0 1/12 1 0 t0m=ckcon.3 (t1m=ckcon.4) timer 0/1 mode 2 (8-bit auto-reload mode) figure 13-3: timer/counter 0 & 1 in mode 2 13.2.4 mode 3 mode 3 has different operating methods for the two timer/counters. for timer/counter 1, mode 3 simply freezes the counter. timer/counter 0, however, conf igures tl0 and th0 as two separate 8 bit count registers in this mode. the logic for this mode is shown in the figure. tl0 uses the timer/counter 0 control bits tc/ , gate, tr0, int0 and tf0. the tl0 can be used to count clock cycles (clock/12) or 1-to-0 transitions on pin t0 as determined by c/t (tmod.2). th0 is forced as a clock cycle counter (clock/12) and takes over the use of tr1 and tf1 from timer/counter 1. mode 3 is used in cases where an extra 8 bit timer is needed. with timer 0 in mode 3, timer 1 can still be used in modes 0, 1 and 2, but its flexibility is somewhat limited. while it s basic functionality is maintained, it no longer has control over its overflow flag tf1 and the enable bit tr1. timer 1 can still be used as a timer/counter and retains the use of gate and int1 pin. in this condition it can be turned on and off by switching it out of and into its own mode 3. it can also be used as a baud rate generator for the serial port. publication release date: april 16, 2009 - 57 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet figure 13-4: timer/counter mode 3 14 nvm memory the w79e4051/2051 series have nvm data memory of 128 bytes for customer?s data store used. the nvm data memory has 8 pages area and each page has 16 bytes. the page addresses are shown on figure 14-1 the nvm memory can be read/write by customer program to access. read nvm data is by movc a,@a+dptr instruction, and write data is by sfr of nvmaddrl, nvmdata and nvmcon. before write data to nvm memory, the page must be erased by providing page address on nvmaddrl, which high and low byte address of on-chip code memory space will decode, then set eer of nvmcon.7. this will automatically hold fetch program code and pc counter, and execute page erase. after finished, this bit will be clear ed by hardware. the eras e time is ~ 5ms. for writing data to nvm memory, user must set address and data to nvmaddrl and nvmdata, then set ewr of nvmcon.6 to initiate nvm dat a write. the uc will hold program code and pc counter, and then write data to mapping address. upon write completion, the ewr bit will be cleared by hardware, the uc will continue execute next instruction. the program time is ~50us. w79e4051/2051 on-chip flash memory space 0000h 4k/2k bytes on-chip code memory unused code memory unused code memory 0fffh/07ffh ffffh fc00h fc7fh 128 bytes nvm data memory nvm data memory area fc1fh fc10h fc0fh fc00h page 0 page 1 page 7 page 2 page 3 page 4 page 5 page 6 128 bytes nvm 16 bytes/page fc3fh fc30h fc2fh fc20h fc5fh fc50h fc4fh fc40h fc7fh fc70h fc6fh fc60h config1 config0 figure 14-1: w79e4051/2051 memory map - 58 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 15 watchdog timer the watchdog timer is a free-running timer whic h can be programmed by the user to serve as a system monitor, a time-base generator or an event time r. it is basically a set of dividers that divide the system clock. the divider output is selectable and determines the time-out interval. when the time-out occurs a flag is set, which can cause an interrupt if enabled, and a system reset can also be caused if it is enabled. the interrupt will occur if the indi vidual interrupt enable and the global enable are set. the interrupt and reset functions are independent of each other and may be used separately or together depending on the user?s software. wdif 512 clock delay mux 500khz rc oscillator uc clock wdte wdrun wd1,wd0 wdclr ewdi ewrst reset interrupt 00 01 10 11 wtrf 26-bits counter time-out selector 16 0 17 19 20 22 23 25 (reset watchdog) (wdcon.1) (wdcon.3) (eie.4) (wdcon.2) (wdcon.0) (wdcon.7) (security bit) (wdcon.5/4) /enable figure 15-1: watchdog timer the watchdog timer should first be restarted by usi ng wdclr. this ensures that the timer starts from a known state. the wdclr bit is used to restart t he watchdog timer. this bit is self clearing, i.e. after writing a 1 to this bit the software will automatically clear it. the watc hdog timer w ill now count clock cycles. the time-out interval is sele cted by the two bits wd1 and wd0 (wdcon.5 and wdcon.4). when the selected time-out occurs, the watchdog interrupt flag wdif (wdcon.3) is set. after the time-out has occurred, the watchdog timer waits for an additional 512 wdt clock cycles. if the watchdog reset ewrst (wdcon.1) is enabled, then 512 clocks after the time-out, if there is no wdclr, a system reset due to watc hdog timer will occur. this will la st for two machine cycles, and the watchdog timer reset flag wtrf (wdcon.2) will be set. this indicates to the software that the watchdog was the cause of the reset. when used as a simple timer, the reset and interrupt functions are disabled. the timer will set the wdif flag each time the timer completes the selected time interval. the wdif flag is polled to detect a time-out and the wdclr allows software to restart the timer. the watchdog timer can also be used as a very long timer. the interrupt feature is enabled in this case. every time the time-out occurs an interrupt will occur if the global interrupt enable ea is set. the main use of the watchdog timer is as a system monitor. this is important in real-time control applications. in case of some power glitches or electro-magnetic interference, the processor may begin to execute errant code. if this is left unc hecked the entire system may crash. using the watchdog timer interrupt during software development will allow the user to select ideal watchdog reset locations. the code is first written without the watchdog interrupt or reset. then the watchdog interrupt is enabled to identify code locations wh ere interrupt occurs. the user can now insert instructions to reset the watchdog timer, which will allow the code to run without any watchdog timer interrupts. now the watchdog timer reset is enabl ed and the watchdog interrupt may be disabled. if any errant code is executed now, then the reset watchdog timer inst ructions will not be executed at the required instants and watchdog reset will occur. the watchdog timer time-out selection will result in different time-out values depending on the clock publication release date: april 16, 2009 - 59 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 60 - speed. the reset, when enabled, will occur when 512 clocks after time-out has occurred. wd1 wd0 interrupt time-out reset time-out number of clocks time @ 10 mhz 0 0 2 17 2 17 + 512 131072 13.11 ms 0 1 2 20 2 20 + 512 1048576 104.86 ms 1 0 2 23 2 23 + 512 8388608 838.86 ms 1 1 2 26 2 26 + 512 67108864 6710.89 ms table 15-1: time-out values for the watchdog timer the watchdog timer will be disabled by a power-on/fail reset. the watchdog timer reset does not disable the watchdog timer, but will restart it. in genera l, software should restart the timer to put it into a known state. the control bits that su pport the watchdog timer are discussed below. 15.1 watchdog control wdif: wdcon.3 - watchdog timer interrupt flag. this bi t is set whenever the time-out occurs in the watchdog timer. if the watchdog interrupt is enabled (eie.4), then an interrupt will occur (if the global interrupt enable is set and other interrupt requireme nts are met). software or any reset can clear this bit. wtrf: wdcon.2 - watchdog timer reset flag. this bit is set whenever a watchdog reset occurs. this bit is useful for determined the cause of a reset. software must read it, and clear it manually. a power-fail reset will clear this bit. if ewrst = 0, then this bit will not be affected by the watchdog timer. ewrst: wdcon.1 - enable watchdog timer reset. this bit when set to 1 will enable the watchdog timer reset function. setting this bit to 0 will disabl e the watchdog timer reset function, but will leave the timer running. wdclr: wdcon.0 - reset watchdog timer. this bit is used to clear the watchdog timer and to restart it. this bit is self-clearing, so after the software writes 1 to it t he hardware will automatically clear it. if the watchdog timer reset is enabled, then the wdclr has to be set by the user within 512 clocks of the time-out. if this is not done then a watchdog timer reset will occur. 15.2 clock control of watchdog wd1, wd0: wdcon.5, wd con.4 - watchdog timer mode select bits. these two bits select the time-out interval for the watchdog timer. the reset time is 512 clocks longer than the interrupt time-out value. the default watchdog time-out is 2 17 clocks, which is the shortest time-out period. the wdrun, wd1, wd0, ewrst, wdif and wdclr bits are protected by the timed access procedure. this prevents software from accidentally enabling or disabling th e watchdog timer. more importantly, it makes it highly improbable that errant code can enable or disable the watchdog timer. the security bit wdtck is located at bit 7 of config register. this bit is used to configure the clock source of watchdog timer from either the internal rc or the uc clock. when wdtck bit is cleared and 500khz clock is used to run the watchdog timer, there is a chance that the watchdog timer would hang as the counter does not increment. this problem arises when the watchdog is set to run, (wdcon.7, wdrun), t he wdclr bit (wdcon.0) is set to clear the watchdog timer and the next instruction is to set the pcon register for cpu to go into idle or power- down state. the reason this happens because t he setting/clearing of wdclr bit and the watchdog counter are running on different clock domains, cpu clock and internal rc clock respectively. when www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 61 - revision a06 wdclr bit is set, to reset it, the counter must be non-zero. since the counter is running off a much slower clock, the counter may not have time to increment before the cpu clock halts as it entered the idle/power-down mode. this results in the w dclr bit is always set & the watchdog counter remaining at zero. the solution to this problem is to monitor the wdclr bit, ens uring that it?s cleared before issue the instruction for the cp u to go into idle/power-down mode. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 62 - 16 serial port (uart) the uart in this device is a full duplex port. it provides the user with additional features such as the frame error detection and the automatic address recognition. the serial port is capable of synchronous as well as asynchronous communicati on. in synchronous mode the device generates the clock and operates in a half duplex mode. in the asynchronous mode, full duplex operation is available. this means that it can simultaneously tr ansmit and receive data. the transmit register and the receive buffer are both addressed as sbuf spec ial function register. however any write to sbuf will be to the transmit register, while a read fr om sbuf will be from the receiver buffer register. the serial port can operate in four different modes as described below. 16.1 mode 0 this mode provides synchronous communication with external devices. in this mode serial data is transmitted and received on the rxd line. txd is used to transmit the shift clock. the txd clock is provided by the device whether it is transmitting or receiving. this mode is therefore a half duplex mode of serial communication. in this mode, 8 bits are transmitted or received per frame. the lsb is transmitted/received first. the baud rate is fixed at 1/12 or 1/4 of the oscillator frequency. this baud rate is determined by the sm2 bit (scon.5). when this bit is set to 0, then the serial port runs at 1/12 of the clock. when set to 1, the serial port runs at 1/4 of the clock. this additional facility of programmable baud rate in mode 0 is the only difference between the standard 8051 and w79e4051/2051. the functional block diagram is shown below. data enters and leaves the serial port on the rxd line. the txd line is used to output the shift clock. the shift clock is used to shift data into and out of this device and the device at the other end of the line. any instruction that causes a write to sbuf will start the transmission. the shift clock will be activated and data will be shifted out on the rxd pin till all 8 bits are transmitted. if sm2 = 1, then the data on rxd will appear 1 clock period before the falling edge of shift clock on txd. the clock on txd then remains low for 2 clock periods, and then goes high again. if sm2 = 0, the data on rxd will appear 3 clo ck periods before the falling edge of shift clock on txd. the clock on txd then remains low for 6 cloc k periods, and then goes high again. this ensures that at the receiving end the data on rxd line can either be clocked on the rising edge of the shift clock on txd or latched when the txd clock is low. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet figure 16-1: serial port mode 0 the ti flag is set high in c1 following the end of transmi ssion of the last bit. the serial port will receive data when ren is 1 and ri is zero. the shift clock (t xd) will be activated and the serial port will latch data on the rising edge of shift clock. the external device should therefore present data on the falling edge on the shift clock. this process continues till al l the 8 bits have been received. the ri flag is set in c1 following the last rising edge of the shift clock on txd. this will stop rec eption, till the ri is cleared by software. 16.2 mode 1 in mode 1, the full duplex asynchronous mode is used. serial communication frames are made up of 10 bits transmitted on txd and received on rxd. the 10 bi ts consist of a start bit (0), 8 data bits (lsb first), and a stop bit (1). on received, the stop bit goes into rb8 in the sfr scon. the baud rate in this mode is variable. the serial baud can be progr ammed to be 1/16 or 1/32 of the timer 1 overflow. since the timer 1 can be set to different reload values, a wide variation in baud rates is possible. transmission begins with a write to sbuf. the serial data is brought out on to txd pin at c1 following the first roll-over of divide by 16 counter. the next bit is placed on txd pin at c1 following the next rollover of the divide by 16 counter. thus the tran smission is synchronized to the divide-by-16 counter and not directly to the write to sbuf signal. after all 8 bits of data are transmitted, the stop bit is transmitted. the ti flag is set in the c1 state a fter the stop bit has been put out on txd pin. this will be at the 10th rollover of the divide by 16 counter after a write to sbuf. reception is enabled only if ren is high. the serial por t actually starts the re ceiving of serial data, with the detection of a falling edge on the rxd pin. t he 1-to-0 detector continuously monitors the rxd line, sampling it at the rate of 16 times the se lected baud rate. when a falling edge is detected, the divide?by-16 counter is immediately reset. this helps to align the bit boundaries with the rollovers of the divide-by-16 counter. publication release date: april 16, 2009 - 63 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet the 16 states of the counter effect ively divide the bit time into 16 slices. the bit detection is done on a best of three bases. the bit detector samples the rxd pin, at the 8th, 9th and 10th counter states. by using a majority 2 of 3 voting system, the bit val ue is selected. this is done to improve the noise rejection feature of the serial port. if the first bit detected after the falling edge of rxd pin is not 0, then this indicates an invalid start bit, and the reception is immediately aborted. the serial port again looks for a falling edge in the rxd line. if a valid start bit is detected, then the rest of the bits are also detected and shifted into the sbuf. after shifting in 8 data bits, there is one more shift to do, after which the sbuf and rb8 are loaded and ri is set. however certain conditions must be met before the loading and setting of ri can be done. 1. ri must be 0 and 2. either sm2 = 0, or the received stop bit = 1. if these conditions are met, then the stop bit goes to rb8, the 8 data bits go into sbuf and ri is set. otherwise the received frame may be lost. after the mi ddle of the stop bit, the receiver goes back to looking for a 1-to-0 transition on the rxd pin. 1/2 1/16 tx clock rx clock ti ri tx shift rx start rx shift load sbuf smod clock sin d8 sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt txd rxd parout rb8 start stop 0 1 bit detector 1-to-0 detector sample 1/16 0 timer 1 overflow 1 receive shift register figure 16-2: serial port mode 1 - 64 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 16.3 mode 2 this mode uses a total of 11 bits in asynch ronous full-duplex communication. the functional description is shown in the figure below. the frame cons ists of one start bit (0), 8 data bits (lsb first), a programmable 9th bit (tb8) and a stop bit (0). the 9th bit received is put into rb8. the baud rate is programmable to 1/32 or 1/64 of the oscillator fre quency, which is determined by the smod bit in pcon sfr. transmission begins with a write to sbuf . the serial data is brought out on to txd pin at c1 following the first roll-over of the divide by 16 counter. the next bit is placed on txd pin at c1 following the next rollover of the divide by 16 count er. thus the transmission is synchronized to the divide-by-16 counter, and not directly to the wr ite to sbuf signal. after all 9 bits of data are transmitted, the stop bit is transmitted. the ti flag is set in the c1 state after the stop bit has been put out on txd pin. this will be at the 11th rollover of the divide-by-16 counter after a write to sbuf. reception is enabled only if ren is high. the serial por t actually starts the re ceiving of serial data, with the detection of a falling edge on the rxd pin. t he 1-to-0 detector continuously monitors the rxd line, sampling it at the rate of 16 times the se lected baud rate. when a falling edge is detected, the divide- by-16 counter is immediately reset. this helps to align the bit boundaries with the rollovers of the divide-by-16 counter. the 16 states of the counter effectively divide the bit time into 16 slices. the bit detection is done on a best of three bases. the bit detector samples the rxd pin, at the 8th, 9th and 10th counter states. by using a majority 2 of 3 voting system, the bit value is selected. this is done to improve the noise rejection feature of the serial port. 1/2 1/16 tx clock rx clock ti ri tx shift rx start rx shift load sbuf smod clock sin d8 sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt txd rxd parout rb8 start stop 0 1 bit detector 1-to-0 detector sample 1/16 0 clock/2 1 d8 tb8 receive shift register figure 16-3: serial port mode 2 publication release date: april 16, 2009 - 65 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet if the first bit detected after the falling edge of rxd pin, is not 0, then this indicates an invalid start bit, and the reception is immediately aborted. the serial port again looks for a falling edge in the rxd line. if a valid start bit is detected, then the rest of t he bits are also detected and shifted into the sbuf. after shifting in 9 data bits, there is one more shift to do, after which the sbuf and rb8 are loaded and ri is set. however certain conditions must be met before the loading and setting of ri can be done. 1. ri must be 0 and 2. either sm2 = 0, or the received stop bit = 1. if these conditions are met, then the stop bit goes to rb8, the 8 data bits go into sbuf and ri is set. otherwise the received frame may be lost. after the mi ddle of the stop bit, the receiver goes back to looking for a 1-to-0 transition on the rxd pin. 16.4 mode 3 this mode is similar to mode 2 in all aspects, except that the baud rate is programmable. the user must first initialize the serial related sfr scon before any communication can take place. this involves selection of the mode and baud rate. t he timer 1 should also be initialized if modes 1 and 3 are used. in all four modes, transmission is starte d by any instruction that uses sbuf as a destination register. reception is initiated in mode 0 by t he condition ri = 0 and ren = 1. this will generate a clock on the txd pin and shift in 8 bits on the rxd pi n. reception is initiated in the other modes by the incoming start bit if ren = 1. the external device will start the comm unication by transmitting the start bit. 1/2 1/16 tx clock rx clock ti ri tx shift rx start rx shift load sbuf smod clock sin d8 sbuf read sbuf internal data bus serial controllor clock load parin tx start internal data bus sbuf write to sout transmit shift register serial interrupt txd rxd parout rb8 start stop 0 1 bit detector 1-to-0 detector sample 1/16 0 1 d8 tb8 timer 1 overflow receive shift register figure 16-4: serial port mode 3 - 66 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 67 - revision a06 sm0 sm1 mode type baud clock frame size start bit stop bit 9th bit function 0 0 0 synch. 4 or 12 tclks 8 bits no no none 0 1 1 asynch. timer 1 10 bits 1 bit 1 bit none 1 0 2 asynch. 32 or 64 tclks 11 bits 1 bit 1 bit 0, 1 1 1 3 asynch. timer 1 11 bits 1 bit 1 bit 0, 1 table 16-1: serial port mode summary table 16.5 framing error detection a frame error occurs when a valid stop bit is not det ected. this could indicate incorrect serial data communication. typically the frame error is due to noise and contention on the serial communication line. the w79e4051/2051 series have the facility to detect such framing errors and set a flag which can be checked by software. the frame error fe bit is located in scon.7. this bit is normally used as sm0 in the standard 8051 family. however, in the w79e4051/2051 series it serves a dual function and is called sm0/fe. there are actually two separate flags, one for sm0 and the ot her for fe. the flag that is actually accessed as scon.7 is determined by smod0 (pcon.6) bit. when smod0 is set to 1, then the fe flag is indicated in sm0/fe. when smod0 is set to 0, then the sm0 flag is indicated in sm0/fe. the fe bit is set to 1 by hardware but must be clear ed by software. note that smod0 must be 1 while reading or writing to fe. if fe is set, then any follo wing frames received without any error will not clear the fe flag. the clearing has to be done by software. 16.6 multiprocessor communications multiprocessor communications makes use of the 9th data bit in modes 2 and 3. in the w79e4051/2051 series, the ri flag is set only if the received byte corresponds to the given or broadcast address. this hardware feature elimi nates the software overhead required in checking every received address, and greatly si mplifies the software programmer task. in the multiprocessor communication mode, the addr ess bytes are distinguished from the data bytes by transmitting the address with the 9th bit set high. when the master processor wants to transmit a block of data to one of the slaves, it first sends out the address of the targeted slave (or slaves). all the slave processors should have their sm2 bit set high when waiting for an address byte. this ensures that they will be interrupted only by the rec eption of an address byte. the automatic address recognition feature ensures that only the addressed slave will be in terrupted. the address comparison is done in hardware not software. the addressed slave clears the sm2 bit, thereby cleari ng the way to receive data bytes. with sm2 = 0, the slave will be interrupted on the reception of ev ery single complete frame of data. the unaddressed slaves will be unaffected, as they will be still waiting fo r their address. in mode 1, the 9th bit is the stop bit, which is 1 in case of a valid frame. if sm2 is 1, then ri is set only if a valid frame is received and the received byte matches the given or broadcast address. the master processor can selectively communicate wi th groups of slaves by using the given address. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 68 - all the slaves can be addressed together using t he broadcast address. the addresses for each slave are defined by the saddr and saden sfrs. the slave address is an 8-bit value specified in the saddr sfr. the saden sfr is actually a mask for the byte value in saddr. if a bit position in saden is 0, then the corresponding bit position in saddr is don't care. only those bit positions in saddr whose corresponding bits in saden are 1 are used to obtain the given address. this gives the user flexibility to address multiple slaves without changing the slave address in saddr. the following example shows how the user can define the given address to address different slaves. slave 1: saddr 1010 0100 saden 1111 1010 given 1010 0x0x slave 2: saddr 1010 0111 saden 1111 1001 given 1010 0xx1 the given address for slave 1 and 2 differ in the lsb. fo r slave 1, it is a don't care, while for slave 2 it is 1. thus to communicate only with slave 1, the master must send an address with lsb = 0 (1010 0000). similarly the bit 1 position is 0 for slave 1 and don't care for slave 2. hence to communicate only with slave 2 the master has to transmit an address with bit 1 = 1 (1010 0011). if the master wishes to communicate with both slaves simultaneously, then the address must have bit 0 = 1 and bit 1 = 0. the bit 3 position is don't care for both the slaves. this allows two different addresses to select both slaves (1010 0001 and 1010 0101). the master can communicate with all the slaves simultaneously with the broadcast address. this address is formed from the logical or of the saddr and saden sfrs. the zeros in the result are defined as don't cares. in most cases the broadca st address is ffh. in the previous case, the broadcast address is (1111111x) for slave 1 and (11111111) for slave 2. the saddr and saden sfrs are located at address a9 h and b9h respectively. on reset, these two sfrs are initialized to 00h. this results in gi ven address and broadcast address being set as xxxx xxxx (i.e. all bits don't care). this effectively re moves the multiprocessor communications feature, since any selectivity is disabled. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 69 - revision a06 17 pulse width modulated outputs (pwm) the w79e4051/2051 contains one pulse width modul ated (pwm) channel which generate pulses of programmable length and interval. the output for pwm0 is on p3.5. after chip reset the internal output of the pwm channel is high. in this case before the pin will reflect the state of the internal pwm output, a ?1? must be written to the port bit that serves as a pwm output. a block diagram is shown in figure 17-1 . the interval between successive outputs is controlled by a 10?bit down counter which uses the internal microcontroller clock as its input. the pwm counter clock has the frequency as f cpwm = p osc /prescaler. the two pre-scaler selectable bits fp[1:0] are located at pwmcon3[1:0]. when the counter reaches underflow it is reloaded with a user selectable value. this mechanism allows the user to set the pwm frequency at any integer sub?multiple of the microcontroller clock frequency. the repetition frequency of the pwm is given by: f pwm = f cpwm / (pwmp+1) where pwmp is contained in pwmph and pwmpl sfr. a compare value greater than the counter reloaded value is in the pwm output being permanently low. in addition there are two special cases. a comp are value of all zeroes, 000h, causes the output to remain permanently high. a compare value of all ones, 3ffh, results in the pwm output remaining permanently low. again the compare value is loaded into a compare register. the transfer from this holding register to the actual compare register is under program control. the pwmp register fact that writes are not into the counter register that controls the counter; rather they are into a holding register. as described below t he transfer of data from this holding register, into the register which contains the actual reload value, is controlled by the user?s program. the width of pwm output pulse is determined by the value in the appropriate compare registers, pwm0l and pwm0h. when the counter describe d above reaches underflow the pwm output is forced high. it remains high until the compare value is reached at which point it goes low and keeps low until the next underflow. the num ber of microcontroller clock pulses that the pwm0 output is high is given by: t hi = (pwmp ? pwm0+1) note : 1. a compare value of all zeroes, 000h, causes the pwm output to remain permanently high. a compare value of all ones, 3ffh, results in the pwm output remain permanently low. a compare value greater than the counter reloaded value w ill result in the pwm output being permanently low. 2. when the pwmrun is cleared, the pwm outputs take on the state prior to the bit being cleared. in general, this state is not known. in order to place the pwm output in a known state when pwmrun is cleared; ? program compare registers to either the ?always 1? or ?always 0? (see note 1). ? set load (and pwmrun) bits to 1. ? wait for pwmf underflow flag or load bit (=0). ? clear pwmrun. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 10-bit down counter compare register counter register pwm0 register + - pwm0 (p3.5) + - x y > load pwmp register clear counter pwm0oe 0 1 p3.5 pwm0i pwmf pwm period interrupt q q set clr d s/w clear vdd underflow vdd clrpwm pwmrun fosc prescaler (1/1, 1/2, 1/4, 1/16) fcpwm (fp1, fp0) posc figure 17-1: pwm block diagram - 70 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 18 analog comparators the w79e4051/2051 is provided an analog comparator shown in figure 18-1 . the comparator output is wired to sfr bit p3.6. when the positive input of ain0(p1.0) is greater than the negative input of ain1(p1.1), the comparator output is high. otherwise the output is low. the comparator may be configured to cause an inte rrupt under a variety of output value conditions by setting bits cm[2:0] in acsr(97h) register and bits cpck[2:0] in acck(96h) register. the cf flag is set whenever the comparator output is matched the setting condition by cm[2:0]. setting bit cipe(comparator idle power-down enable) in acsr.5 to high makes the analog comparator is active in power-down and idle mode, therefore the comparator interrupt can wake up cpu from power down and idle mode. figure 18-1: analog comparator publication release date: april 16, 2009 - 71 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 72 - 18.1 comparator interrupt with debouncing the comparator output is sampled at every state 4 (s4) of every machine cycle. the conditions on the analog inputs maybe cause the comparator output toggle excessively, especially applying slow moving analog inputs. table 18-2: comparator interrupt mode shows the 8 comparator interrupt modes set by cm[2:0] in acsr(97h). a built-in c onfigurable debouncing timer provides 8 debouncing timing controlled by cpck[2:0] for widely applications. the debouncing timing is shown in table 18-1 . if cpu is in normal/idle mode f db is from fosc; if cpu is in power-down mode f db is from internal rc 22m/11m hz oscillator. cpck2 cpck 1 cpck 0 debouncing time 0 0 0 (3/f db )*2~(4/f db )*2 0 0 1 (3/f db )*4~(4/f db )*4 0 1 0 (3/f db )*8~(4/f db )*8 0 1 1 (3/f db )*16~(4/f db )*16 1 0 0 (3/f db )*32~(4/f db )*32 1 0 1 (3/f db )*64~(4/f db )*64 1 1 0 (3/f db )*128~(4/f db )*128 1 1 1 (3/f db )*256~(4/f db )*256 table 18-1: comparator debouncing time cm2 cm1 cm0 comparator interrupt mode 0 0 0 negative (low) level 0 0 1 positive edge 0 1 0 toggle with debounce 0 1 1 positive edge with debounce 1 0 0 negative edge 1 0 1 toggle 1 1 0 negative edge with debounce 1 1 1 positive (high) level table 18-2: comparator interrupt mode three debouncing modes are provided to filter out this noise. in debouncing mode when the comparator output matches one of three debouncing mode condition, the debouncing timer resets and starts up-counting. the end of debouncing triggers the hardware to check if the comparator output matches the mode condition or not. if it is compliant wi th the mode condition the comparator flag cf is set by hardware, otherwise cf keeps low. refer to figure 18-2 . www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet figure 18-2: example of n egative edge comparator inte rrupt with debouncing 18.2 application circuit it is recommended to add a decoupled capacitor as close as port pin for reducing the variation of offset voltage as show in figure 18-3 . figure 18-3: application circuit of comparator publication release date: april 16, 2009 - 73 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 74 - 19 time access proctection the w79e4051/2051 series have a new feature, like the watchdog timer which is a crucial to proper operation of the system. if left unprotected, errant code may writ e to the watchdog control bits resulting in incorrect operation and loss of control. in order to prevent this, the w79e4051/2051 series have a protection scheme which controls the write access to critical bits. this protection scheme is done using a timed access. in this method, the bits which are to be protec ted have a timed write enable window. a write is successful only if this window is active, otherwise the write will be discarded. this write enable window is open for 3 machine cycles if certain conditions are met. after 3 machine cycles, this window automatically closes. the window is opened by writ ing aah and immediately 55h to the timed access (ta) sfr. this sfr is located at address c7h. the suggested code for opening the timed access window is ta reg 0c7h ;define new register ta, @0c7h mov ta, #0aah mov ta, #055h when the software writes aah to the ta sfr, a counter is started. this counter waits for 3 machine cycles looking for a write of 55h to ta. if the second write (55h) occurs within 3 machine cycles of the first write (aah), then the timed access window is opened. it remains open for 3 machine cycles, during which the user may write to the protected bi ts. once the window closes the procedure must be repeated to access the other protected bits. examples of timed assessing are shown below. example 1: valid access mov ta, #0aah ;3 m/c note: m/c = machine cycles mov ta, #055h ;3 m/c mov wdcon, #00h ;3 m/c example 2: valid access mov ta, #0aah ;3 m/c mov ta, #055h ;3 m/c nop ;1 m/c setb ewrst ;2 m/c example 3: valid access mov ta, #0aah ;3 m/c mov ta, #055h ;3 m/c orl wdcon, #00000010b ;3m/c example 4: invalid access mov ta, #0aah ;3 m/c mov ta, #055h ;3 m/c nop ;1 m/c nop ;1 m/c clr ewt ;2 m/c example 5: invalid access mov ta, #0aah ;3 m/c www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 75 - revision a06 nop ;1 m/c mov ta, #055h ;3 m/c setb ewt ;2 m/c in the first three examples, the writing to the protected bits is done before the 3 machine cycles window closes. in example 4, however, the writing to the protected bit occurs after the window has closed, and so there is effectively no change in th e status of the protected bit. in example 5, the second write to ta occurs 4 machine cycles after t he first write, therefore t he timed access window is not opened at all, and the write to the protected bit fails. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 76 - 20 i/o port mode setting w79e4051/2051 has maximum one 8-bit(p1), one 7-bit(p3) and one 2-bit(p2) ports. except p1.0 and p1.1, all pins are quasi-bidrectional mode, which are common with standard 80c51, that the internal weakly pull-ups are present as the port registers are set to logic one. p1.0 and p1.1, the alternate function are analog comparator inputs, stays in pm os-off open-drain mode after cpu reset. the p2.0 (xtal2) can be configured as cl ock output by setting bit enclk to high when cpu clock source is from on-chip rc or external oscillator, and the frequency of clock output is divided by 4 on on-chip rc clock or external oscillator. 20.1 quasi-bidirectional output configuration after chip was power on or reset, the all ports except p1.0 and p1.1 output are in this mode, and output is common with the mcs-51. this mode c an be used as both an input and output without the need to reconfigure the port. p1.0~p1.1 stays in pmos-off open-drain mode after cpu reset. p1m1.y port input/output mode 0 open drain 1 quasi-bidirectional table 20-1: i/o port configuration table when the pin is pulled low, it is driven strongly and ab le to sink a fairly large current. these features are similar to an open drain output except that t here are three pull-up transistors in the quasi- bidirectional output that serve different purposes. this mode has three pull-up resisters that are ?str ong? pull-up, ?weak? pull-up and ?very weak? pull-up. the ?strong? pull-up is used fast transition from logic ?0? change to logic ?1?, and it is fast latch and transition. when port pins is occur from logic ?0? to logic ?1?, the strong pull- up will quickly turn on two cpu clocks to pull high then turn off. the ?weak? pull-up is turned on when the input port pin is logic ?1? level or itself is logic ?1?, and it provides the most source current for a quasi-bidirectional pin that output is ?1? or port latch is logic ?0??. the ?very weak? pull-up is turned on when the port latch is logic ?1?. if port latch is logic ?0?, it will be turned off. the very weak pull-up is support a very sma ll current that will pull the pin high if it is left floating. and the quasi-bidirectional port configuration is shown as below figure. if port pin is low, it can drives lar ge sink current up to about 20ma/10ma at v dd =5v/2.7v. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet port pin 2 cpu clock delay input data port latch data pp p n vdd strong very weak weak figure 20-1: quasi-bidirectional output 20.2 open drain output configuration p1.0 and p1.1 are in open drain type after chip reset. to configure this mode is turned off all pull-ups. if used similar as a logic output, the port must has an external pull-up resister. the open drain port configuration is shown as below. port pin port latch data n input data figure 20-2: open drain output publication release date: april 16, 2009 - 77 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 21 oscillator the w79e4051/2051 series provides three oscillator input option. these are configured at config register (config0) that include on-chip rc oscillator option, external clock input option and crystal oscillator input option. the crystal osc illator input frequency may be supported from 4mhz to 24mhz, and without capacitor or resister. fosc0 fosc1 00h 11h 01h crystal oscillator external clock input internal rc oscillator 16 bits ripple counter cpu clock power monitor reset power down peripheral clock f cpu figure 21-1: oscillator 21.1 on-chip rc oscillator option the on-chip rc oscillator of w79e4051r and W79E2051r is trimmed by factory and is configurable to 11.0592mhz/22.1184mhz 2% (through configuration-bit fs1 bit) frequency to support clock source. when fosc1, fosc0 = 01h, the on-chip rc oscillator is enabled. a clock output on p2.0 (xtal2) may be enabled when on-chip rc oscillator is used. note: for the untrimmed parts of W79E2051 and w79e40 51, the untrimmed frequency of internal rc oscillator may have 25% deviation compared to the nominal frequency in 22.1184mhz. it maybe has an potential risk that cpu runs ov er specified speed if the untrimmed frequency is over 24mhz. 21.2 external clock input option the clock source pin (xtal1) is from external clock input by fosc1, fosc0 = 11h, and frequency range is form 4mhz up to 24mhz. a clock output on p2.0 (xtal2) may be enabled when external clock input is used. the w79e4051/2051 series supports a clock output function when either the on-chip rc oscillator or the external clock input options is selected. this allows external devices to synchronize to the w79e4051/2051 serial. when enabled, via the enclk bit in the acck.7, the clock output appears on the xtal2/clkout pin whenever the on-chip osc illator is running, including in idle mode. the frequency of the clock output is 1/ 4 of the cpu clock rate. if the clo ck output is not needed in idle mode, it may be turned off prior to entering idle mode for saving additional power. the clock output may also be enabled when the external clock input option is selected. - 78 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 22 power monitoring function in order to prevent incorrect operation durin g power up and power drop, the w79e4051/2051 is provided a power monitor function, brownout detect. 22.1 brownout detect and reset the w79e4051/2051 has an on-chi p brown-out detection circuit for monitoring the v dd level during operation by comparing it to a pr ogrammable brownout trigger leve l. there are 4 brownout trigger levels available for wider voltage applications. the 4 nominal levels are 2.4v, 2.7v, 3.8v and 4.5v (programmable through bov.1-0 bits). when v dd drops to the selected brownout trigger level (v bor ), the brownout detection logics will either reset the cpu until the v dd voltage raises above v bor or requests a brownout interr upt at the moment that v dd falls and raises through v bor . the brownout detection circuits also provides a low power brownout detection mode for power saving. when lpbov=1, the brownout detection repeatedly senses the voltage for 64/f brc then turn off detector for 960/ f brc if v dd voltage still below brownout trigger level. f brc , the frequency of built-in rc oscillator, is approximately 100k* v dd hz 50%. the relative control bits are located in sfr auxr1 @a2h. the brownout detect block is shown in figure 22-1 . brownout detect circuit 0 1 bof to reset to brownout interrupt bov[1:0] bod lpbov boi bos figure 22-1: brown-out detect block publication release date: april 16, 2009 - 79 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet vbor+ vbor - v dd boi=0 to select brown-out reset set by hardware clear by software hysterisis voltage is about 30mv~150mv for each bod voltage lev el boi=1 to select brown-out interrupt clear by software t bor : brown-out reset delay time with about 8ms nominal brown- out voltage brown-out status bos t bor 8ms reset bof figure 22-2: brown-out voltage detection hysterisis range of brownout detect voltage is about 30mv to 150mv - 80 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 23 icp (in-circuit program) flash mode the icp(in-circuit-program) mode is another appro ach to access the flash eprom. there are only 3 pins needed to perform the icp function. one is mode input, shared with rst pin, which must be kept in vdd voltage in the entire icp working period. o ne is clock input, shared with p1.7, which accepts serial clock from external device. another is dat a i/o pin, shared with p1.6, that an external icp program tool shifts in/out data via p1.6 synchroni zed with clock(p1.7) to access the flash eprom of w79e4051/2051. user may refer to http://www.manley.com.cn/english/index.asp for icp program tool. W79E2051 w79e4051 rst(pin1) p1.6 p1.7 v dd vss to application to application to application v dd v pp data clock vss icp writer tool vcc jumper [1] icp connector system board icp power switch [2] [2] [2] [2] note: 1. circuitry separation is op tionally needed between icp and application during icp operation. 2. resistor is optional by application figure 23-1: icp writer tool connector pin assign note: 1. when using icp to upgrade code, the rst, p1.6 and p1.7 must be taken within design system board. 2. after program finished by icp, to suggest system power must power off and remove icp connector then power on. 3. it is recommended that user performs erase func tion and programming configure bits continuously without any interruption. publication release date: april 16, 2009 - 81 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 24 config bits the w79e4051/2051 has two config bits (config0 located at fb00h, config1 located at fb01h) that must be defined at power up and can not be set by the program after start of execution. those features are configured through the use of two flash eprom bytes, and the flash eprom can be programmed and verified repeatedly. until the code in side the flash eprom is confirmed ok, the code can be protected. the protection of flash eprom (config1) and those operations on it are described below. 24.1 config0 wdtck cbov1 cbov0 0 - bpfr fosc1 fosc0 config0 figure 24-1: config0 register bits bit name function 7 wdtck clock source of watchdog timer select bit: 0: the internal 500khz rc oscillator clock is for watchdog timer clock used. 1: the uc clock is for watchdog timer clock used. 6~5 cbov1 cbov0 brownout voltage selection bits: sfr bits (bov1,bov0) are initialized at rese t with the inversed value of config0-bits (cbov1,cbov0) cbov.1 cbov.0 brownout voltage 1 1 brownout voltage is 2.4v 1 0 brownout voltage is 2.7v 0 1 brownout voltage is 3.8v 0 0 brownout voltage is 4.5v 2 bpfr bypass clock filter. 0: disable clock filter. 1: enable clock filter. 1 fosc1 cpu oscillator type select bit 1. 0 fosc0 cpu oscillator type select bit 0. oscillator configuration bits: fosc1 fosc0 osc source 0 0 4mhz ~ 24mhz crystal 0 1 internal rc oscillator (fs1 bit in config1.5 will determine either 11mhz or 22mhz) xt1 and xt2 function as p2.1 and p2.0 1 0 reserved 1 1 external oscillator in xtal1; xt2 is in tri-state - 82 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 24.2 config1 c7 c6 fs1 - - - - - config1 figure 24-2: config1 register bits bit name function 7 c7 4k/2k program flash eprom lock bit this bit is used to protect the customer?s program code. it may be set after the programmer finishes the programming and verifies sequence. once this bit is set to logic 0, both the flash eprom data and config registers can not be accessed again. 6 c6 128 byte data flash eprom lock bit this bit is used to protect the customer?s 12 8 bytes of data code. it may be set after the programmer finishes the programming and verifies sequence. once this bit is set to logic 0, both the 128 bytes of flash eprom data and co nfig registers can not be accessed again. 5 fs1 internal oscillator 11mhz/22mhz selection bit this bit is used to select 11mh z or 22mhz internal oscillator. 1: internal oscillator is set to 22mhz 0: internal oscillator is set to 11mhz 0~4 - reserved. lock bits c7 and c6: bit 7 bit 6 function description 1 1 both security of 4k/2kb program code and 128 bytes data area are not locked. they can be erased, programmed or read by writer or icp. 0 1 the 4k/2kb program code area is locked. it can not be read and written by writer or icp. the 128 bytes data area can be program one time or read. 1 0 not supported. 0 0 both security of 4k/2kb program code and 128 bytes data area are locked. they can not be read and written by writer or icp. publication release date: april 16, 2009 - 83 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet - 84 - 25 electrical characteristics 25.1 absolute maximum ratings symbol parameter conditio n minimum maximum unit dc power supply v dd v dd ? v ss -0.3 +7.0 v input voltage v in v ss -0.3 v dd +0.3 v operating temperature ta -40 +85 c storage temperature tst -55 +150 c sink current isk - 95 ma ram keep alive voltage v ram 1.4 +7.0 v maximum current into v dd - 120 ma maximum current out of v ss 120 ma maximum current suck by a i/o pin 25 ma maximum current sourced by a i/o pin 25 ma maximum current suck by total i/o pins 80 ma maximum current sourced by total i/o pins 80 ma note : exposure to conditions beyond those lis ted under absolute maximum ratings may adversely affects the lift and reliability www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 85 - revision a06 25.2 dc electrical characteristics (vss = 0v, ta =-40~85 c, unless otherwise specified; typical value is test at ta=25 c) specification parameter sym. min. typ. max. unit test conditions 2.4 5.5 v v dd =2.4v ~ 5.5v @ 12mhz v dd =4.5v ~ 5.5v @ 24mhz operating voltage v dd 3.0 5.5 program and erase data flash. i dd1 2 3.5 ma no load, rst = v dd , v dd = 3.0v @ 12mhz operating current i dd2 8 12 ma no load, rst = v dd , v dd = 5.0v @ 24mhz i idle1 1.6 2.5 ma no load, v dd = 3.0v @ 12mhz idle current i idle2 6.5 7.5 ma no load, v dd = 5.0v @ 24mhz power down current i pwdn1 0.5 10 a no load, v dd = 5.0/3.0v (brownout detection is disabled) input / output input current p1, p2, p3 i in1 -50 - +10 a v dd = 5.5v, v in = 0v or v in =v dd input current rst pin [1] i in2 -55 - -30 a v dd = 5.5v, v in = 0.45v input leakage current p1.0, p1.1(open drain) i lk -1 - +1 a v dd = 5.5v, 0 preliminary w79e4051/w 79e2051 data sheet - 86 - 13 20 24 ma v dd = 4.5v, v s = 0.45v sink current p1, p2, p3 (quasi-bidirectional mode) i sk1 8 13 17 ma v dd = 2.4v, v s = 0.45v brownout voltage with bov[1:0]=00 v bo2.4 2.25 2.4 2.55 v brownout voltage with bov[1:0]=01 v bo2.7 2.55 2.7 2.75 v brownout voltage with bov[1:0]=10 v bo3.8 3.65 3.8 3.90 v brownout voltage with bov[1:0]=11 v bo4.5 4.30 4.5 4.65 v i bo1 160/135 210/170 a no load, v dd = 5.0/3.0v average current at brownout detection active (lpbov=0) brownout detection current i bo2 24/11 32/15 a no load, v dd = 5.0/3.0v average current at brownout detection active (lpbov=1, 1/16 mode) 35 - 150 mv v dd = 2.4v~5.5v, (lpbod,boi) = (0,x) or (1,0) hysterisis range of bod voltage v bh 10 - 60 mv v dd = 2.4v~5.5v, (lpbod,boi)=(1,1) power on reset voltage v por 1.45 2.0 2.10 v with hysterisis ~= 450mv notes: *1. rst pin is a schmitt trigger input. *2. xtal1 is a cmos input. *3. pins of p1, p2 and p3 can source a transition current when they are being externally driven from 1 to 0. the transition cu rrent reaches its maximum value when vin approximates to 2v. www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet publication release date: april 16, 2009 - 87 - revision a06 25.3 the comparator electrical characteristics (vdd? vss = 3.0~5v 10%, ta = -40~85 c, fosc = 24mhz, unless otherwise specified.) specification parameter symbol min. typ. max. unit test conditions common mode range comparator inputs v cr 0 v dd -0.3 v common mode rejection ratio cmrr -50 db response time t rs - 50 100 ns comparator enable to output valid time t en - 1 5 us input leakage current, comparator i il -10 0 10 ua 0< v in preliminary w79e4051/w 79e2051 data sheet 25.4 ac electrical characteristics t clcl t clcx t chcx t clch t chcl note: duty cycle is 50%. 25.5 external clock characteristics parameter symbol variable clock min. variable clock max. units oscillator frequency 1/t clcl 0 24 mhz parameter symbol min. typ. max. units notes clock high time t chcx 18.8 - - ns clock low time t clcx 18.8 - - ns clock rise time t clch - - 10 ns clock fall time t chcl - - 10 ns - 88 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 25.6 rc osc and ac characteristics (vdd? vss = 2.4~5v, ta = -40~85 c.) specification (reference) test conditions parameter min. typ. max. unit W79E2051/w79e4051 frequency accuracy of on- chip rc oscillator (without calibration) -25 25 % v dd =2.4v~5.5v, ta = -40 c ~85 c dd =2.4v~5.5v, ta = -40 c ~85 c -2 2 % v dd =5.0v, ta = 25 c -5 5 % v dd =2.7v~5.5v, ta = 0~85 c -7 7 % v dd =2.7v~5.5v, ta = -20~85 c W79E2051r/w79e4051r on-chip rc oscillator with calibration 1,2 (fosc = 22.1184mhz with factory calibration) -9 7 % v dd =2.7v~5.5v, ta = -40~85 c wakeup time 256 clk note: 1. these values are for design guidance only and are not tested. 2. rc frequency deviation vs. v dd and temperature is shown below -12 -9 -6 -3 0 3 6 2.2 2.7 3.2 3.7 4.2 4.7 5.2 supply voltage (v) frequency deviation (%) t=85c t=50c t=25c t=0c t=-20c t=-40c publication release date: april 16, 2009 - 89 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 26 typical application circuits xtal2 xtal1 w79e4051/ 2051 c1 c2 r the table below shows the reference values for crystal applications. crystal c1 c2 r 4mhz ~ 24 mhz without without without - 90 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 27 package dimensions 27.1 20-pin sop l o c e h a1 a e b d seating plane y 0.25 gauge plane e 1 20 11 10 7.60 0.32 0.51 0.30 e c b a1 7.40 0.23 0.33 0.10 0.299 0.013 0.020 0.012 0.291 0.009 0.013 0.004 max. dimension in mm 2.65 a symbol min. 2.35 dimension in inch 0.104 min. 0.093 max. control demensions are in milmeters . 1.27 0.10 10.65 l y h 08 0.40 10.00 e 1.27 bsc 0.050 0.004 0.419 0 0.016 0.394 8 0.050 bsc e d 12.60 13.00 0.496 0.512 figure 27-1: 20l sop-300mil publication release date: april 16, 2009 - 91 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 27.2 20-pin dip 1.63 1.47 0.064 0.058 symbol min nom max max nom min dimension in inch dimension in mm a b c d e a l s a a 1 2 e 0.060 1.52 0.175 4.45 0.010 0.125 0.016 0.130 0.018 0.135 0.022 3.18 0.41 0.25 3.30 0.46 3.43 0.56 0.008 0.120 0.375 0.010 0.130 0.014 0.140 0.20 3.05 0.25 3.30 0.36 3.56 0.255 0.250 0.245 6.48 6.35 6.22 9.53 7.62 7.37 7.87 0.300 0.290 0.310 2.29 2.54 2.79 0.090 0.100 0.110 b 1 1 e e 1 1.026 1.040 20.06 26.42 01 5 0.075 1.91 0.355 0.335 8.51 9.02 15 0 seating plane a e 2 a c e base plane 1 a 1 e l a s 1 e d 1 b b 20 11 0 11 figure 27-2: 20l dip-300mil - 92 - www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 27.3 20-pin ssop 0 0.002 0.197 0.291 7.80 0 7.40 8 8.20 5.30 b e d c 6.90 5.00 a1 a2 a 5.60 7.50 7.20 2.00 1.85 8 0.3230.307 0.073 0.079 0.220 0.272 0.295 0.283 0.209 min. dimension in inch symbol dimension in mm min. nom max. max. nom 0.05 e l l1 y q 0.009 0.015 0.004 0.010 0.021 0.030 0.050 0.004 0.22 0.38 0.09 0.25 0.65 0.0256 0.55 0.75 1.25 0.10 h e 0.95 0.037 1.75 1.65 0.065 0.069 1 20 d e e y b a1 a2 a seating plane dteail a l l1 q detail a seating plane e h 10 11 b figure 27-3: 20-pin ssop publication release date: april 16, 2009 - 93 - revision a06 www.datasheet.in
preliminary w79e4051/w 79e2051 data sheet 28 revision history version date page description a01 july 9, 2008 - initial issued a02 august 4, 2008 78 86 85 1. add a notice for the untrimmed internal rc osc. 2. modify the test condition of ?hysterisis range of bod voltage? in dc spec. 3. modify the max value of power down current. a03 august 29, 2008 86 91 1. revised maximum current suck by total i/o pins from 75ma to 80ma. 2. modify ?24.6 rc osc and ac characteristics? a04 december 22, 2008 25 88 83 1. revise the description of sfr bit lpbov 2. correct i bo2 3215 with 32/15. 3. add chapter 23 icp a05 february 25, 2009 5, 84 1. add dc spec of data flash program/erase voltage a06 april 16, 2009 5,6,7 94 1. add ssop20 parts of w79e4051arg/rarg and W79E2051arg/rarg. 2. add ssop-20 package dimension diagram. important notice nuvoton products are not designed, intended, authorized or warranted for use as components in systems or equipment intended for surg ical implantation, atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, or for other applications intended to support or sustain life. further more, nuvoton products are not intended for applications wherein failure of nuvoton products could result or lead to a situation wherein personal injury, death or severe property or environmental damage could occur. nuvoton customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify nuvoton for any damages resulting from such improper use or sales. - 94 - www.datasheet.in


▲Up To Search▲   

 
Price & Availability of W79E2051

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X